Getting key codes of remote controls handled in X just using evdev and not LIRC

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 6 23:11:17 PDT 2010


On Sun, Apr 04, 2010 at 06:54:24PM +0200, Paul Menzel wrote:
> Dear X.org folks,
> 
> 
> »In X you can use xev to find the keycodes and xmodmap to map them to
> useful symbols. Unfortunately, some keys may generate keycodes that X
> doesn't recognize at all and the device does not support keymaps, or
> this would be easy to fix.« [1]
> 
> Do you know if there exist a solution already for this problem? Most of
> the keys of the remote control (for example play, pause) do not generate
> an event in `xev` on my system.
> 
> I read [2] and searched the Web for more information but did not find a
> solution not involving LIRC.
> 
> At the and you will find the generated key codes by evdev.(?) Do you
> know of a way to just create a keymap(?) file to map those key codes to
> X events(?)?
> 
> I am sorry to ask you, but the input system (scan codes, key codes, X
> mapping(?)) is still very complicated for me to understand.

because of core protocol limitations, keycodes > 255 aren't processed by the
server. that explains why some keys don't generate any events.
with the X required offset of 8 you can do the math based on the defines in
linux/input.h to get from the kernel's scancodes to X's keycodes (simply
keycode = scancode + 8, provided keycode < 255)

bits and pieces are slowly falling into place to resolve this issue in the
future but right now the limit is there.

play and pause should work though, to name the two examples. they certainly
work well enough on my multimedia keyboards, so I don't see why the remote
should be much different.
For this issue, it's probably best to file a bug with all logs attached so
we can have a look at what's going wrong.


Cheers,
  Peter



More information about the xorg mailing list