Hi,
Wanted to report a incorrect configuration for a Xiaomi remote and a fix for it. Documenting this fairly detailed to assist anyone else that may have a similar issue.
This is a guide on how to remap this invalid keycode. See "70-local-keyboard.hwdb" part for what should be added to libreelec's defaults.
# cat /proc/bus/input/devices
I: Bus=0005 Vendor=2717 Product=32b9 Version=4a4c
N: Name="Xiaomi RC Consumer Control"
P: Phys= ......................
S: Sysfs=/devices/virtual/misc/uhid/0005:2717:32B9.0003/input/input8
U: Uniq= ......................
H: Handlers=kbd event1
B: PROP=0
B: EV=13
B: KEY=50 0 0 0 0 0 38200 2 0 0 0 0 0 3000 d8011001 1c1680 0 0 0
B: MSC=10
I: Bus=0005 Vendor=2717 Product=32b9 Version=4a4c
N: Name="Xiaomi RC Keyboard"
P: Phys= ......................
S: Sysfs=/devices/virtual/misc/uhid/0005:2717:32B9.0003/input/input10
U: Uniq= ......................
H: Handlers=sysrq kbd leds event2
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff fff80f80 3c00f002
B: MSC=10
B: LED=1f
Default mapping of the button.
# systemctl stop kodi
# /storage/.kodi/addons/virtual.system-tools/bin/evtest
....
Event: time 1668034708.559812, -------------- SYN_REPORT ------------
Event: time 1668034708.717304, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0041
Event: time 1668034708.717304, type 1 (EV_KEY), code 28 (KEY_SELECT), value 0
Event: time 1668034708.717304, -------------- SYN_REPORT ------------
But to work with kodi this needs to be mapped to KEY_ENTER and it defaults to KEY_SELECT.
# udevadm test /devices/virtual/misc/uhid/0005:2717:32B9.0003/input/input8 2>&1 | grep ^MODALIAS
MODALIAS=input:b0005v2717p32B9e4A4C-e0,1,4,k72,73,74,80,8C,90,9B,9C,9E,9F,AC,AD,161,189,18F,190,191,244,246,ram4,lsfw
Create, or update, the file /storage/.config/hwdb.d/70-local-keyboard.hwdb with the following entry. Device-identifier (red) you get from udevadm and the keycode (green) comes from evtest.
evdev:input:b0005v2717p32B9e4A4C*
KEYBOARD_KEY_c0041=enter
Reload udev rules, or just reboot.
# udevadm hwdb --update
# udevadm trigger -s input
and now i got a working Xiaomi remote.