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.
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
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
Section "InputClass" Identifier "Keyboard catchall" MatchIsKeyboard "on" Option "XkbModel" "pc104" Option "XkbLayout" "us" Option "XkbOptions" "ctrl:nocaps" Option "XkbVariant" "" EndSection
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.