[keyboard dell XPS] infinite xev loop + wrong keycodes?
Submitted by Eatdirt
Assigned to Xorg Project Team
Description
Hi, I have been trying to define a few multimedia keys on a laptop dell xps m1210 and encountered the following strange behavior. Only one key works but with a wrong keycode and all the others generate an infinite keypress event loop. I sum up the story for two keys, if someone has any idea how it could be fixed, please help... Sorry if this is just the result of my ignorance...
My Xorg is running on mandriva cooker:
X Window System Version 1.3.0 Release Date: 19 April 2007 X Protocol Version 11, Revision 0, Release 1.3 Build Operating System: UNKNOWN Current Operating System: Linux dru 2.6.17-13mdv #1 (closed) SMP Fri Mar 23 15:18:36 EDT 2007 x86_64 Build Date: 04 May 2007
The story:
- the two magic keys I want to use (MediaDirect and Camera) as they appear in dmesg:
atkbd.c: Use 'setkeycodes e012 <keycode>
' to make it known.
atkbd.c: Unknown key pressed (translated set 2, code 0x95 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e015 <keycode>
' to make it known.
- Therefore I defined the keycodes as required (inspired by /usr/include/linux/input.h)
setkeycodes e012 226 setkeycodes e015 212
- Now I want to see if they are detected in X, and I tested that with xev:
First for the MediaDirect key. It works but the keycode is wrong, there is always a shift between the one I set and the one reported (I tested various free keycodes with setkeycodes).
KeyPress event, serial 32, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2151022928, (100,103), root:(789,126), state 0x0, keycode 237 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
Now, since I really want to use that key anyway I set the following with xmodmap: keycode 237 = XF86VendorHome
I tested again with xev, and the log is:
KeyRelease event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2151762376, (42,106), root:(731,129), state 0x0, keycode 237 (keysym 0x1008ff34, XF86VendorHome), same_screen YES, XKeysymToKeycode returns keycode: 226 XLookupString gives 0 bytes: XFilterEvent returns: False
The keycode 226 shows up again, so something seems to be broken there?
Now for the camera key (e015), that's shorter. Only one press in xev triggers an infinite loop. Again, the keycode is wrong, 187 instead of 212? The same occurs with all the other funny keys (Fn+Hibernate; or Fn+Battery) which are detected by the kernel in dmesg. Once the loop is triggered, the only way to recover a keypress event with they key that started to loop is to restart the X server.
KeyPress event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161136, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161169, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161169, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161203, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161203, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
KeyRelease event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161236, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
KeyPress event, serial 33, synthetic NO, window 0x3000001, root 0x156, subw 0x0, time 2152161236, (65,83), root:(754,106), state 0x0, keycode 187 (keysym 0x0, NoSymbol), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
etc.....
- The pb does not occur on the console side. If I press the Camera key under "showkey", no loop appears. However, the result is also weird since it looks like if I had pressed three keys:
showkey keycode 0 press keycode 1 release keycode 84 release