Linux Remote Key Mapping
I want to customize keys of the Logitech Presenter R800 remote. But the technique should be applicable to any keyboard.
Will need evtest
Information sources:
- source1;
- source2;
- Finding USB devices with lsusb & idVendor – idProduct;
- comments in
/lib/udev/hwdb.d/60-keyboard.hwdb
.
Steps
- connect your peripheral;
- run
sudo evtest
to examine events generated when you press the keys; - add to
/lib/udev/hwdb.d/60-keyboard.hwdb
:
# Logitech Presenter R800
evdev:input:b0003v046DpC538*
KEYBOARD_KEY_07004b=left
KEYBOARD_KEY_07004e=right
KEYBOARD_KEY_070029=playpause
KEYBOARD_KEY_07003e=playpause
KEYBOARD_KEY_070037=displaytoggle
- update hardware db by running:
sudo systemd-hwdb update sudo udevadm trigger --verbose --sysname-match="event*"