Spontaneous remapping of "i" and "m" keys lazarus / 9-Editor ---------------------------------------------------------------------- del · 2019-09-13 10:17 All of a sudden now when I type lowercase "i" in the editor it inserts a tab in front of it. And when I type lowercase "m" in the editor it inserts a carriage return in front of it. Here's what I just typed - you can see what happened when I typed "i" and "m". (The carriage return after the number "0" was normal, the rest are "automatic" when I type the "m"). Quoteabcdefgh   ijkl mnopqustuvwxyz1234567890    ijkl mjkl mkl ml m m m m mMMMMMMMIIIIIIII This is really distracting. What did I do to mess this up? I closed Lazarus and reopened it and the problem is still there. ---------------------------------------------------------------------- rvk · 2019-09-13 10:31 See if this is also the case in Notepad (Start > type notepad + enter) Restart your computer and see if it's still there. If it is, shut down your computer again, clean your keyboard (usually pressing hard on all keys will clean it a bit) and restart the computer to see if the problem remains. ---------------------------------------------------------------------- del · 2019-09-13 10:38 OK - I'm on Linux and tried to repeat this behavior using Geany but the behavior of the keys "i" and "m" was normal. I'll try restarting the computer and see if that clears it. Thanks. ---------------------------------------------------------------------- winni · 2019-09-13 10:45 Sound like you get an unwanted CTRL key: Ctrl I is TAB and Ctrl M is carriage return. Lift off both Ctrl keys on the keyboard and look if something has fallen into the keyboard: paper clip? ---------------------------------------------------------------------- del · 2019-09-13 10:58 I shut the computer off. Did some things. Restarted the computer. Now the problem is gone: Quoteabcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ So it was just some crazy thing. But THANKS !!! I get so much joy out of FPC / Lazarus. And I learn a lot just browsing this forum. ---------------------------------------------------------------------- Kays · 2019-09-13 20:15 Quote from: del on September 13, 2019, 12:58:29 pm[…] Now the problem is gone: […]Maybe lack of ECC memory? The other day I had some crazy problem with my keyboard, too: After a pm-suspend-hybrid(8) phase some keys of my external keyboard had a different mapping, whilst all other keys and the internal keyboard had the correct layout. Re-plugging the keyboard or re-loading the mapping did not make a difference, nor did another short pm-suspend(8). Only a reboot(8) “solved” the issue. ---------------------------------------------------------------------- Martin_fr · 2019-09-13 22:59 https://bugs.freepascal.org/view.php?id=29432 The issues is known. But apparently very rare. ---------------------------------------------------------------------- del · 2019-09-13 23:20 Well I just came back to say that the problem briefly returned: "i" = /t "m" = /n but this time I was able to clear it by just closing Lazarus, then reopening it. Anyway I'm having a riot with this awesome IDE - no complaints.  Oops - forgot to mention, from help about: Version #: 2.0.4 Date: 2019-09-06 FPC Version: 3.0.4 SVN Revision: Unversioned directory x86_64-linux-gtk2 ---------------------------------------------------------------------- Martin_fr · 2019-09-14 02:01 Its a long time I looked at the gtk parts of the IDE code..... IIRC there were some tricky bits in handling the ctrl key.  (and some other modifiers). It is possible that some of this goes wrong under some conditions.... But I have no idea. If it becomes to bad: - Try QT - try pressing and releasing, each of the 2 ctrl keys. - Find some of the related bug reports about double key presses. There is a "set env" in one of them, to disable using some inputmethod from the OS. Big maybe.... no idea... Try to remember if you used the ctrl key before it started, and how you used it. Maybe (like on windows ctrl-tab) switching application via keyboard. So Lazarus would not see the release of the tab key. (Still the OS should know...) If you find ways to reproduce, or other clues, add to the bug report. You can also run the IDE from a terminal to see the IDE log output. And there are various conditional compiles to get more feedback, but I am not sure which exactly. grep the lazarus sources for IFDEF and either KEY or PRESS I think something like VERBOSE_KEYS or similar. Then build the IDE with it defined: -dVERBOSE_KEYS Sorry it is a bit vague... ---------------------------------------------------------------------- del · 2019-09-14 05:00 Thanks for the suggestions. I frequently use the left ctrl key (ctrl-c) copy, (ctrl-v) paste, (ctrl-s) to save. And I even more frequently use the tab key for indents (we use tab indents at work so I try to keep my habits consistent). I'll launch Lazarus from the command line. I'll post anything I learn - thanks again. ---------------------------------------------------------------------- Martin_fr · 2019-09-14 10:07 I had a look, for more verbose logging, compile the IDE with -dVerboseKeyboard -dVerboseKeys and (if compiles) -dVerboseModifiermap --- There are also alternative implementations, but they are ages old, and likely will not compile / And I have no idea what they do, or if they will affect you (if they still work....) -dUseOwnShiftState and/or -dUse_KeyStateList ---------------------------------------------------------------------- del · 2019-09-15 15:24 Thanks for the suggestions. I've been launching it from the command line (startlazarus) and haven't seen any problems after over 18 hours of intense coding. So the problem is not really at nuisance level. If I do get any clues I'll post them.