Had remarkably a lot of trouble getting my old X10 RF remote set up to work with Kodi. Linux keymapping isn't quite as trivial as it once was. Here are the steps I followed:
1. find the device vendor with lsusb. Mine was 0BC7.
2. Find all the device's modalias files with
find /sys -name *modalias | xargs grep -i 0BC7
3. Use the one that is a single string. Mine was the file at
/sys/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1:1.0/modalias
My modalias string looks like this. We want everything before the 'e',
because we want it to apply to all versions.
input:b0003v0BC7p0002e0100-e0,1,2,k110,111,113,114,r0,1,amlsfw
4. Using heavy reference to this Arch wiki page,
https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes
/usr/include/linux/input.h
I create a hwdb file in /etc/udev/hwdb.d/10-x10.hwdb. It contains:
Here's the HWDB file
evdev:input:b0003v0BC7p0002*
KEYBOARD_KEY_00=esc # setup
KEYBOARD_KEY_2c=favorites # learn
KEYBOARD_KEY_02=power # power
KEYBOARD_KEY_03=tv # tv
KEYBOARD_KEY_04=audio # audio
KEYBOARD_KEY_31=tv2 # cable
KEYBOARD_KEY_05=pc # pc
KEYBOARD_KEY_06=vcr # x10
KEYBOARD_KEY_0b=up # ch+
KEYBOARD_KEY_08=volumedown # vol-
KEYBOARD_KEY_0a=mute # m
KEYBOARD_KEY_09=volumeup # vol+
KEYBOARD_KEY_0c=down # ch-
KEYBOARD_KEY_0d=1 # 1
KEYBOARD_KEY_0e=2 # 2
KEYBOARD_KEY_0f=3 # 3
KEYBOARD_KEY_10=4 # 4
KEYBOARD_KEY_11=5 # 5
KEYBOARD_KEY_12=6 # 6
KEYBOARD_KEY_13=7 # 7
KEYBOARD_KEY_14=8 # 8
KEYBOARD_KEY_15=9 # 9
KEYBOARD_KEY_17=0 # 0
KEYBOARD_KEY_16=numeric_star # add/del
KEYBOARD_KEY_18=numeric_pound # a/b
KEYBOARD_KEY_19=fn_f1 # red – album
KEYBOARD_KEY_1b=fn_f2 # yellow – artist
KEYBOARD_KEY_21=fn_f3 # green – genre
KEYBOARD_KEY_23=fn_f4 # blue – track
KEYBOARD_KEY_1c=pageup # pg up
KEYBOARD_KEY_20=pagedown # pgdown
KEYBOARD_KEY_1a=up # thumb up
KEYBOARD_KEY_1d=left # thumb left
KEYBOARD_KEY_1f=right # thumb right
KEYBOARD_KEY_22=down # thumb down
KEYBOARD_KEY_1e=enter # thumb press
KEYBOARD_KEY_01=fn_f5 # purple – playlist
KEYBOARD_KEY_2d=fn_f6 # orange – playing
KEYBOARD_KEY_2e=home # t top
KEYBOARD_KEY_2f=end # e end
KEYBOARD_KEY_07=find # find
KEYBOARD_KEY_30=select # select
KEYBOARD_KEY_2b=previoussong # scan -
KEYBOARD_KEY_24=rewind # rewind
KEYBOARD_KEY_25=playpause # play
KEYBOARD_KEY_26=fastforward # fast fwd
KEYBOARD_KEY_2a=nextsong # scan +
KEYBOARD_KEY_27=record # rec
KEYBOARD_KEY_28=stop # stop
KEYBOARD_KEY_29=pause # pause