Making Caps-Lock a Control key on Adesso keyboards

Gautam Iyer gi1242+xorg at cmu.edu
Thu Aug 27 19:25:33 PDT 2009


On Fri, Aug 28, 2009 at 11:39:40AM +1000, Peter Hutterer 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?

Nope! It's on the same keyboard. The keyboard I have is

    http://www.adesso.com/products_detail.asp?productid=295

I've been reading the Xkb documentation. Is there any trick I can use
with ignorelockmods to fix this? Alternately is there some way I can
make only the control key sticky? At this point, I'll take whatever I
can get.

Thanks,

GI

-- 
Modern Computer Viruses:
Oprah Winfrey Virus -- Your 200MB hard drive suddenly shrinks to 80MB,
and then slowly expands back to 200MB.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20090827/e7c55cb0/attachment.pgp>


More information about the xorg mailing list