I’m going to try and list every bit of information I can find regarding this matter:
First of all, the underlying problem seems to be that X11 doesn’t recognize keystrokes >255 as described here: 11227 – (x11-keycode-limit) Allow > 255 keycodes
Given that this bugs exist since 2007 it’s probably not going to get fixed - ever.
The possible workaround #1 is using a patched version of bluez that allows us to use /etc/bluetooth/input.conf to remap the keys on the remote. The translation of keypresses >255 seems to take place in the bluez-4.101_ps3remote.diff patch as mentioned in this article:
https://www.mythtv.org/wiki/Sony_PS3_BD_Remote#Linux_installation_process
I don’t know if this patch can be applied to the current bluez version (5.23 I think?) and am not experienced enough in Linux stuff to try, fail and repair my mistake.
Another way to get around the X11 >255 bug is by building the xf86-input-evdev driver as described here:
https://www.mythtv.org/wiki/Remapping_remote_control_key_codes_greater_than_255
I don’t know if any of these fixes can be integrated into OSMC, or patched manually as both procedures use outdated patches.
Basically what needs to be done, is to remap the keys >255 to keys <255. This seems to be more complicated than it sounds though, at least to my untrained ears.
BTW: What does this script do? osmc/ps3_remote.py at master · osmc/osmc · GitHub
Could the remapping be implemented there?
This is the output of evtest:
`Available devices:
/dev/input/event0: Logitech K400
/dev/input/event1: lircd
/dev/input/event2: BD Remote Control
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x54c product 0x306 version 0x110
Input device name: “BD Remote Control”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 28 (KEY_ENTER)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Event code 119 (KEY_PAUSE)
Event code 128 (KEY_STOP)
Event code 139 (KEY_MENU)
Event code 158 (KEY_BACK)
Event code 159 (KEY_FORWARD)
Event code 161 (KEY_EJECTCD)
Event code 168 (KEY_REWIND)
Event code 172 (KEY_HOMEPAGE)
Event code 207 (KEY_PLAY)
Event code 256 (BTN_0)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 315 (BTN_START)
Event code 317 (BTN_THUMBL)
Event code 318 (BTN_THUMBR)
Event code 353 (KEY_SELECT)
Event code 355 (KEY_CLEAR)
Event code 357 (KEY_OPTION)
Event code 358 (KEY_INFO)
Event code 359 (KEY_TIME)
Event code 370 (KEY_SUBTITLE)
Event code 371 (KEY_ANGLE)
Event code 375 (KEY_SCREEN)
Event code 392 (KEY_AUDIO)
Event code 398 (KEY_RED)
Event code 399 (KEY_GREEN)
Event code 400 (KEY_YELLOW)
Event code 401 (KEY_BLUE)
Event code 407 (KEY_NEXT)
Event code 412 (KEY_PREVIOUS)
Event code 436 (KEY_FRAMEBACK)
Event code 437 (KEY_FRAMEFORWARD)
Event code 438 (KEY_CONTEXT_MENU)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing … (interrupt to exit)
This device is grabbed by another process.
No events are available to evtest while the
other grab is active.
In most cases, this is caused by an X driver,
try VT-switching and re-run evtest again.
Run the following command to see processes with
an open fd on this device
“fuser -v /dev/input/event2”
`
In terminal every single keystroke is detected correctly. So the problem definitely must be, that X11 doesn’t recognize keystrokes >255