[Tfug] The 'state' of a key??

Kyle Buehler kyle at grndzero.org
Wed Nov 23 11:40:49 MST 2005


Chris Hill wrote:

> Ok, so I've got 5 buttons on my laptop that are assignable in windows, 
> but in linux they just map to the numbers 1-5. If I press any of the 
> buttons (in a console or in x) I just get the numbers 1-5. In an 
> attempt to discern what's going on, the only useful info I got was 
> from xev:
>
>
> Pressing the button:
> KeyPress event, serial 29, synthetic NO, window 0x3400001,
>    root 0xe9, subw 0x0, time 9940924, (169,-18), root:(174,30),
>    state 0x40, keycode 14 (keysym 0x35, 5), same_screen YES,
>    XLookupString gives 1 bytes: (35) "5"
>    XmbLookupString gives 1 bytes: (35) "5"
>    XFilterEvent returns: False
>
> Pressing the '5' key:
> KeyPress event, serial 29, synthetic NO, window 0x3400001,
>    root 0xe9, subw 0x0, time 9953163, (169,-18), root:(174,30),
>    state 0x0, keycode 14 (keysym 0x35, 5), same_screen YES,
>    XLookupString gives 1 bytes: (35) "5"
>    XmbLookupString gives 1 bytes: (35) "5"
>    XFilterEvent returns: False
>
>
> So the only discernible difference is the 'state' variable.
>
> Using showkey (in console, not pseudo-terminal) I was able to get this:
> (the first line is the press byte, and the 2nd is the release byte)
> Keyboard:
> 1:
> 0x02
> 0x82
> 2:
> 0x03
> 0x83
> 3:
> 0x04
> 0x84
> 4:
> 0x05
> 0x85
> 5:
> 0x06
> 0x86
>
> Assignable buttons(again, first line is press, second is release):
> 1:
> 0x7e 0x02
> 0x82 0xfe
> 2:
> 0x7e 0x03
> 0x83 0xfe
> 3:
> 0x7e 0x04
> 0x84 0xfe
> 4:
> 0x7e 0x05
> 0x85 0xfe
> 5:
> 0x7e 0x06 0x86 0xfe
>
> Button 5 only sends a release, hence its code being all on one line.
>
> Any ideas on how to get this to work?
> Thanks
> C
>
>
> _______________________________________________
> tfug mailing list
> tfug at tfug.org
> http://www.tfug.org/mailman/listinfo/tfug
>
Hotkeys will allow you to use them as shortcut buttons in X. Sometimes 
it's a pain to get setup though. apt-get install hotkeys on debian. I 
think it's apt-get'able if you're using apt4rpm and freshrpms also.

Here's a starter though 
http://www.tldp.org/LDP/Mobile-Guide/html/mobile-guide-p2c1s8-ext-keys.html



More information about the tfug mailing list