I'm using Caps Lock as a Control key, configured with the following command (I'm running Gnome):
gsettings set org.gnome.desktop.input-sources xkb-options \
"['caps:ctrl_modifier']"
Sometimes when I press a Control-modified key, the key autorepeats. For example, I'll type Ctrl-w and all of a sudden the w key starts repeating as if I were holding it down. I suspect a keyup event is being lost. The repeat goes on indefinitely until I hit another key.
Also maybe related, sometimes when I press a Control-modified key, it simply does nothing, as if I "pressed it wrong". I just try again and it works, but I suspect this is another symptom of the same underlying problem.
How can I debug/fix this? I'd like to see which keyboard events are being sent, and when.
Update
I still haven't found a fix for this (not sure what to do about the answer below, because it's helpful information, but did not solve my issue), but I used xinput to monitor the keyboard events involved.
It appears to be related to "rollover", because I can only reproduce the key-repeat bug with key-sequences like press Caps
, press W
, release Caps
, release W
(as opposed to releasing W before releasing Caps).
I also can only reproduce the bug in X, not in a virtual console.
I emptied out the xkb-options
I had set via gsettings
, and am now relying on /etc/X11/xorg.conf.d/00-keyboard.conf
instead:
Section "InputClass"
Identifier "Keyboard catchall"
MatchIsKeyboard "on"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
Option "XkbOptions" "ctrl:nocaps"
Option "XkbVariant" ""
EndSection
I switched caps:ctrl_modifier
to ctrl:nocaps
because it works in the virtual console as well as X.
So I'm still hunting for a solution, but I feel I've at least learned a few things in the process.
ctrl:nocaps
instead ofcaps:ctrl_modifier
. they are subtly different options. compare the definitions in/usr/share/X11/xkb/symbols/ctrl
and../symbols/capslock
for details. – quixotic Feb 20 '18 at 02:37ctrl:nocaps
because that works in virtual console as well. It didn't solve my problem, but it was a good find, and got me thinking more clearly about keysyms. – ivan Feb 20 '18 at 04:05