I have an X11 program that grabs caps-lock, and uses it. The problem is, I want to disable the regular caps-lock toggling, but doing so seems to disable the key.
So whatever X11 gets for a caps-lock keypress, it must still get (no disabling the key, or remapping it to some other key), but without anything translating the keypress into a caps-toggle (which might be at the kernel level?).
I tried changing the scancode, but this just remapped the key.
I've removed the capslock entry with xmodmap
too, but this also disabled caps.
How can I tell the kernel to ignore the caps-key (wrt its regular functionality), but still pass along the message to X?
Just to add a bit more detail:
The 'program' I'm trying to run is humanised 'enso'.
When there is no key I get the error "CRITICAL:root:Couldn't find quasimode key". When there is no error, I can use enso with caps, but sofar haven't figured out how to disable caps functionality while enso is still able to get at it.
Best Answer
I think I have a technique for disabling the toggling of the Capslock key but not completely disabling the key all together, or remapping it to another key on the keyboard.
If you use the command:
The keyboard will no longer toggle. I've confirmed this on my laptop running Fedora 14, the LED no longer lights up, and normal Capslock functionality is gone.
However using xev still shows that the key is being pressed:
So the key being pressed events are still left intact for other applications to pick them up.
setxkbmap
The file
/usr/share/X11/xkb/rules/xorg.lst
contains the complete list of what options you can give tosetxkbmap
.Grepping through this file for "cap" I noticed this line:
There are other values in this file so if this isn't what you're after perhaps one of those alternate values would suite instead.
References