Remap MCE Remote SUSPEND button

  • Hi, all!!

    I've read Infrared Remotes [LibreELEC.wiki], but that's been only partially helpful, and I haven't been able to do things the way I want them.

    I have LibreELEC working 99.9% of how I want it. My sole remaining issue has to do with my lack of ability to remap the KEY_SLEEP remote button. I've already successfully remapped KEY_POWER to CECActivateSource via a keymap file.

    My problem is that somewhere at a lower level, KEY_SLEEP is mapped to KEY_POWER, so Kodi doesn't see a difference between them. Looking in /etc/eventlircd.d I see that there are 5 different files in which seems to be remapped to KEY_POWER.

    Furthermore, using a laptop to debug the remote I see that KEY_POWER produces keycode 151 (0x97), while KEY_SLEEP produces 150 (0x96). However, I see no keymaps in /usr/lib/udev/rc_keymaps that associate 0x96 to KEY_SLEEP or 0x97 to KEY_POWER ... so I have no clue where this is defined.

    So the key questions are:

    1) where at the O/S level is KEY_SLEEP getting remapped to KEY_POWER?

    2) if it's via a file in /etc/eventlircd.d (a *.evmap file), how do I override those mappings via /storage/.config? (or somesuch that will be preserved across updates)

    I've been unable to use ir-keytable to do testing on the LE box itself because I get the "/sys/class/rc: No such file or directory" problem when I try to run ir-keytable, but I've not found information on how to correctly load the correct IR receiver driver (even in the link above).

    Any help or additional links for reference would be greatly appreciated!

  • If you dont't have /sys/class/rcX, then the remote receiver is quite certainly a HID device and the remote appears as a keyboard to the system.

    Changing scancode-to-keycode mappings via ir-keytable is not possible in this case, but you can change the keycodes with a udev hwdb file - see eg here: Ok button doesn't work on H1 remote

    To see all keycodes generated by the receiver you can use evtest (from the system tools package).

    Some of these "keyboard" remotes are routed through eventlircd, by udev rules matching the device attributes. In that case the button presses show up as LIRC events instead of keyboard events in kodi debug log.

    so long,

    Hias

  • That's exactly what's happening: it's getting mapped via eventlircd - which means that either eventlircd or someone "before it" is remapping KEY_SLEEP to KEY_POWER.

    I'll try your link, which appears to offer a solution.

    Thanks!