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:
setxkbmap -option caps:none
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:
$ xev
...
...
KeyPress event, serial 35, synthetic NO, window 0x6800001,
root 0xb1, subw 0x0, time 261504852, (167,-15), root:(353,268),
state 0x10, keycode 66 (keysym 0xffffff, VoidSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 35, synthetic NO, window 0x6800001,
root 0xb1, subw 0x0, time 261504971, (167,-15), root:(353,268),
state 0x10, keycode 66 (keysym 0xffffff, VoidSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
...
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 to setxkbmap
.
Grepping through this file for "cap" I noticed this line:
caps:none CapsLock is disabled
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.
$ grep cap /usr/share/X11/xkb/rules/xorg.lst
grp:caps_switch CapsLock (while pressed), Alt+CapsLock does the original capslock action
grp:caps_toggle CapsLock
grp:shift_caps_toggle Shift+CapsLock
grp:shift_caps_switch CapsLock (to first layout), Shift+CapsLock (to last layout)
grp:alt_caps_toggle Alt+CapsLock
lv3:caps_switch CapsLock
lv3:caps_switch_latch CapsLock (chooses 3rd level, latches when pressed together with another 3rd-level-chooser)
ctrl:nocaps Make CapsLock an additional Ctrl
ctrl:swapcaps Swap Ctrl and CapsLock
grp_led:caps CapsLock
caps CapsLock key behavior
caps:internal CapsLock uses internal capitalization. Shift "pauses" CapsLock
caps:internal_nocancel CapsLock uses internal capitalization. Shift doesn't affect CapsLock
caps:shift CapsLock acts as Shift with locking. Shift "pauses" CapsLock
caps:shift_nocancel CapsLock acts as Shift with locking. Shift doesn't affect CapsLock
caps:capslock CapsLock toggles normal capitalization of alphabetic characters
caps:numlock Make CapsLock an additional NumLock
caps:swapescape Swap ESC and CapsLock
caps:escape Make CapsLock an additional ESC
caps:backspace Make CapsLock an additional Backspace
caps:super Make CapsLock an additional Super
caps:hyper Make CapsLock an additional Hyper
caps:shiftlock CapsLock toggles Shift so all keys are affected
caps:none CapsLock is disabled
compose:caps CapsLock
shift:breaks_caps Shift cancels CapsLock
shift:both_capslock Both Shift-Keys together toggle CapsLock
shift:both_capslock_cancel Both Shift-Keys together activate CapsLock, one Shift-Key deactivates
References
setxkbmap -option ctrl:nocaps
remaps toControl_L
, for example. – Chris Down May 12 '13 at 04:42