You are not logged in.

#1 2011-07-09 09:57:05

dvdhrm
Member
From: Germany
Registered: 2011-01-22
Posts: 23

Remapping keys of single evdev device in X

Hi

I have a device that reports key input via /dev/input/eventX file. It has a "1", "2", "a", "b" and some more buttons and thus reports BTN_1 BTN_2, BTN_A, BTN_B, ... events. These correspond to the right keys, though, they aren't very useful in X. I want them to map to KEY_ENTER, KEY_BACKSPACE and some more, however, I can't use the global mapping via xmodmap since then my mouse (which also reports BTN_1, BTN_2 events) would not work anymore.

Is there any easy way in X or evdev-driver to remap the events of a single device? One possible approach is creating a meta-device that reads my /dev/input/eventX and reports them mapped as a new device /dev/input/eventY. This is possible via uinput kernel driver. This isn't very handy, though.

I am not that familiar with the xkb files. I guess there is a way to create an own xkb mapping for the device, but some hints where to start would be really nice.

Regards
David

Offline

Board footer

Powered by FluxBB