[Tfug] The 'state' of a key??
dave jordan
quantumnonlocality at gmail.com
Fri Nov 18 19:00:42 MST 2005
"state" refers to whether shift, ctrl, or alt (et al?), or any
combination thereof, was
"considered" part of the keypress. usually but not necessarily it
means you physically pressed the modifier key at the same time as the
main key.
On 11/18/05, Chris Hill <ubergeek at ubergeek.tv> 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
>
More information about the tfug
mailing list