39aldo39 / klfc

Keyboard Layout Files Creator
GNU General Public License v3.0
219 stars 12 forks source link

Simulating Control+w sometimes inserts a bunch of Ws #10

Closed noctuid closed 6 years ago

noctuid commented 6 years ago

I have this in my config:

"shiftlevels": [ "None", "Shift", "AltGr", "Shift+AltGr", "Extend" ],
....
{ "pos": "W", "letters": [ "w", "W", "`", "~", "Control+w" ] },

I use Control+w for "backspace a word" functionality in a lot of applications. Most of the time this works fine, but maybe 5% of the time, after the deleting a word a bunch of ws will be continuously inserted (even though I'm not pressing any keys). It may also simulate C-w a few times and delete more than one word. (I'm using XKB)

39aldo39 commented 6 years ago

This probably isn't caused by the XKB config, since it can't even express multiple key presses.

I think that your w key sometimes remains pressed for a short time, which may be caused by some program or your keyboard. If you still have Extend down, it will execute C-w a few times. If you don't, it will execute w a few times. This also happens if you manually hold w down for a little longer.

If this is the case, it is probably fixed by disabling autorepeat or by increasing its delay time. But you obviously would lose autorepeat, which you may not want. You can disable it by executing xset r off (xset r on turns it on again). You can also disable it just for the w key by executing xset -r 25. The delay time can be changed by executing xset r rate $milliseconds.

noctuid commented 6 years ago

I can't intentionally trigger this behavior regardless of how long I hold down either key, but after disabling repeat for w, I haven't noticed the issue anymore. For whatever reason, this doesn't happen with any other key and doesn't happen with w if I bind it to something different. I'll continue to test, but I think disabling repeat solved the issue.

Edit: this actually happens when I bind w to other keys. I never had this issue before using klfc, but I'm guessing that's just a coincidence.