Can one list all key symbols evdev will currently generate an event for?

Peter Hutterer peter.hutterer at who-t.net
Sun Jan 11 14:53:14 PST 2015


On Sun, Jan 11, 2015 at 12:49:41AM +0100, Thomas Lübking wrote:
> See subject - I'm "fighting" with an RC.
> 
> evtest reports all configured key symbols, but "xinput test" does not -
> despite all configured symbols (no matter which) are listed in "Supported
> Events". The codes that events are generated for seem pretty random (ie. not
> only those below eg. 128/255)
> 
> XkbModel and XkbKeycodes are both set to evdev. No explicit XkbRules,
> XkbVariant or XkbOptions.

xinput shows the key codes (which is equivalent to (KEY_foo + 8) in
linux/input.h). For historical reasons though you don't get the exact codes
a device supports, every devices simply initialises codes 8-255.

Those codes are translated into keysyms on the client side, based on the XKB
layout. You can use the various xlib functions to traverse the layout, but
it's a bit more complicated than it may seem since you need to take
modifiers, groups, etc. into account.

If you want to know "which physical keys does the keyboard actually have"
then this isn't possible in X at the moment.

Cheers,
   Peter


More information about the xorg mailing list