Help required to discover "key id" for remote control (LibreElec Kodi 19.1b Pi 4)
#1
I'd like to map the power button on my Packard Bell Remote Control / USB receiver to display the power menu rather than shutting down Kodi altogether.

I am familiar with custom mapping, and have used the keymap editor add on already to remap the blue remote button... E.g

<keymap>
<global>
<keyboard>
<key id="254">RunScript(script.audio.profiles,0)</key> <!-- rotates through the profiles -->
</keyboard>
</global>
</keymap>

The problem I am having is that I am unable to discover the "key ID" for the power off button using the keymap editor as expected. Is there another method that I can use to detect this?


https://github.com/torvalds/linux/blob/m...x10-or2x.c

^^ I've discovered a reference to the remote control driver here, but unfortunately adding either of the following lines hasn't worked:

<key id="0x02">ActivateWindow(shutdownmenu)</key> <!-- prevents shutdown button from powering off machine -->

<key id="2">ActivateWindow(shutdownmenu)</key>     <!-- prevents shutdown button from powering off machine -->
Reply
#2
OK after no such luck with keycodes extracted via ir-keytable -t, I have found a solution through trial and error.

It looks like some of the key presses register as keyboard and others as remote! Adding a new sub section has allowed me to define function for the power button. Instead of powering off when accidentally pressed, it now presents a menu instead.
Quote:<keymap>
  <global>
    <keyboard>
        <key id="254">RunScript(script.audio.profiles,0)</key>      <!-- rotates through the profiles -->
    </keyboard>
    <remote>
        <power>ActivateWindow(shutdownmenu)</power>
    </remote>
  </global>
</keymap>
Reply
#3
If you turn on debug logging, every key that Kodi receives is logged in the debug log (wiki).

That information would probably contain the codes you are/were looking for.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#4
I had a look through kodi.log after enabling logging, but couldn't find any reference to keystrokes / presses at all after navigating around the GUI. Should it log such info by default?
Reply
#5
Yes, but only if logging is enabled.

That said, it might be that the ir tables bit could be getting in the way, but normally every keypress or action that Kodi can/should act on is logged when debug logging is enabled.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#6
Might be an old thread but for anyone looking for a solution

So I ran into the same issue on Libreelec 10.0.2 (Kodi 19.4).
Whenever I wanted to use the remote keymap editor with the power button, the system would just shutdown insted of getting the key code for shutdown. Manually adding it as "keyboard" did not work, but a great tip on adding it as "remote" 

I noticed earlier that The Remote keymap editor renamed the noBS.xml file in libreelec. This file used to just disable windowed mode that is available in Kodi with the "\" key, however a couple of versions back they added a new global

Code:

<rewind>NoOp</rewind> 

and I never knew why this was added to NoBS.xml. I think I now see. 

What made this come to mind is looking in my log at the shutdown command I saw a "rewind"   command (via Lirc I believe which is supposedly not used or disabled) . So not only did I add the remote section in addition to the keyboard section  , I also reactivated the noBS.xml that the keymap editor had disabled by renaming it.

Not sure which made it work adding the remote section or re-enabling noBS.xml but working now with shutdown menu.

By chance are you running libreelec? I think they have moved away from Lirc now by default, but it can still be activated.
Reply

Logout Mark Read Team Forum Stats Members Help
Help required to discover "key id" for remote control (LibreElec Kodi 19.1b Pi 4)0