Making Caps-Lock a Control key on Adesso keyboards

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 27 18:39:40 PDT 2009


On Thu, Aug 27, 2009 at 08:57:14PM -0400, Gautam Iyer wrote:
> I just bought a new Adesso keyboard, and found that I am unable to make
> caps lock a control key.
> 
> Usually I just do
> 
>     setxkbmap -option ctrl:swapcaps
> 
> or alternately use xmodmap, and swap control and caps lock on all my
> keyboards. However this doesn't quite work on my new Adesso keyboard.
> The left control works as caps lock just fine. But the caps lock does
> not work as control. 
> 
>     KeyPress event, serial 31, synthetic NO, window 0x1100001,
>         root 0x1f0, subw 0x0, time 2428520, (121,111), root:(2470,722),
>         state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
>         XLookupString gives 0 bytes:
>         XmbLookupString gives 0 bytes:
>         XFilterEvent returns: False
> 
>     KeyPress event, serial 31, synthetic NO, window 0x1100001,
>         root 0x1f0, subw 0x0, time 2430328, (121,111), root:(2470,722),
>        state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
>         XLookupString gives 1 bytes: (03) ""
>         XmbLookupString gives 1 bytes: (03) ""
>         XFilterEvent returns: False
> 
>     KeyRelease event, serial 31, synthetic NO, window 0x1100001,
>         root 0x1f0, subw 0x0, time 2430384, (121,111), root:(2470,722),
>         state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
>         XLookupString gives 1 bytes: (03) ""
> 
>     KeyRelease event, serial 31, synthetic NO, window 0x1100001,
>         root 0x1f0, subw 0x0, time 2432808, (121,111), root:(2470,722),
>         state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
>         XLookupString gives 0 bytes:
> 
> Now with my control/caps lock switched, pressing Caps-Lock+c gives
> 
>     KeyPress event, serial 31, synthetic NO, window 0x1100001,
> 	root 0x1f0, subw 0x0, time 2435112, (121,111), root:(2470,722),
> 	state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
> 	XKeysymToKeycode returns keycode: 37
> 	XLookupString gives 0 bytes:
> 	XmbLookupString gives 0 bytes:
> 	XFilterEvent returns: False
> 
>     KeyRelease event, serial 31, synthetic NO, window 0x1100001,
> 	root 0x1f0, subw 0x0, time 2435936, (121,111), root:(2470,722),
> 	state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
> 	XKeysymToKeycode returns keycode: 37
> 	XLookupString gives 0 bytes:
> 
>     KeyPress event, serial 31, synthetic NO, window 0x1100001,
> 	root 0x1f0, subw 0x0, time 2435936, (121,111), root:(2470,722),
> 	state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
> 	XLookupString gives 1 bytes: (63) "c"
> 	XmbLookupString gives 1 bytes: (63) "c"
> 	XFilterEvent returns: False
> 
>     KeyRelease event, serial 31, synthetic NO, window 0x1100001,
> 	root 0x1f0, subw 0x0, time 2436008, (121,111), root:(2470,722),
> 	state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
> 	XLookupString gives 1 bytes: (63) "c"
> 
> Notice that as soon as I press "c" (while holding down caps-lock), a
> Control_L key release event is generated *before* the keypress event for
> my key "c". After that the keypress event for "c" is generated with
> state 0.
> 
> Does anyone know what I can do? I've temporarily turned on sticky
> modifiers to solve the problem, but I don't like that. I'd like to have
> my control/caps swapped on my new Adesso keyboard.

this usually happens if the modifier key is on a different device than the
actual key (and only up to server 1.6).
this isn't the case for you, is it?

Cheers,
  Peter



More information about the xorg mailing list