[Gta04-owner] X keycode of the Power/AUX buttons
neil at ossau.homelinux.net
Mon Nov 14 15:18:37 CET 2011
On 12.11.2011 09:05, NeilBrown wrote:
> On Sat, 12 Nov 2011 09:55:32 +0100 "Dr. H. Nikolaus Schaller"
> <hns at goldelico.com> wrote:
>> Am 12.11.2011 um 08:35 schrieb Dr. H. Nikolaus Schaller:
>> > Am 11.11.2011 um 17:09 schrieb Neil Jerram:
>> >> I'm still not clear on whether and how there is a mapping from
>> the values like KEY_OK that are fed _into_the_bottom_ of evdev, and
>> the keycode values like <POWR> that come _out_of_the_top_ of evdev and
>> feed into X.
Finally, from evdev_key.c:
#define MIN_KEYCODE 8
EvdevKeyProcess (InputInfoPtr pInfo, struct input_event *ev)
int keycode = ev->code + MIN_KEYCODE;
So the magic mapping algorithm is just "+ 8". Hence KEY_POWER (116) ->
X keycode 124 as observed.
>> Maybe the best choice is to do it identical to the GTA02.
>> Who knows the kernel key code of the GTA02?
> Power button returns code 116 - Power
> AUX button returns code 169 - Phone
> The head-set button returns code 207 - Play
Yes, these look good. Then,
- the AUX X keycode would be 177, for which XKB has keysym XF86Phone.
The kernel constant for 169 is KEY_PHONE.
- the head-set button would be 215, for which XKB has keysym
XF86AudioPlay. The kernel constant for 207 is KEY_PLAY.
More information about the Gta04-owner