I've got debug logging enabled, so I'm able to see what's going on behind the scenes.
My setup is like this:
I have a Harmony remote setup with a button assigned with the "Blue" command. A flirc is used on the RPi2 running Librelec 8.2.5.
In the flirc gui, I mapped the f4 key to the "blue" button I setup in the harmony remote software. The logs show that f4 is what is interpreted when I hit the button on the remote, so that's what I figured I needed to map in my keyboard.xml.
Both the python and bash script work when invoked manually, so that's good. Any thoughts on why my keyboard.xml doesn't work? I reboot each time I change something in there in order for LibreElec to load the new code.
I'm assuming the output OnKey: f4 (0xf093) presses, action is .................. being empty is a problem?
kodi.log
15:16:32.149 T:1945329664 DEBUG: OnKey: f4 (0xf093) pressed, action is
15:16:32.193 T:1945329664 DEBUG: Keyboard: scancode: 0x3e, sym: 0x011d, unicode: 0x0000, modifier: 0x0
15:16:34.319 T:1945329664 DEBUG: Previous line repeats 1 times.
15:16:34.319 T:1945329664 DEBUG: OnKey: f4 (0xf093) pressed, action is
15:16:34.362 T:1945329664 DEBUG: Keyboard: scancode: 0x3e, sym: 0x011d, unicode: 0x0000, modifier: 0x0
15:16:34.691 T:1945329664 DEBUG: Previous line repeats 1 times.
15:16:34.692 T:1945329664 DEBUG: OnKey: f4 (0xf093) pressed, action is
15:16:34.734 T:1945329664 DEBUG: Keyboard: scancode: 0x3e, sym: 0x011d, unicode: 0x0000, modifier: 0x0
15:16:35.064 T:1945329664 DEBUG: Previous line repeats 1 times.
15:16:35.064 T:1945329664 DEBUG: OnKey: f4 (0xf093) pressed, action is
15:16:35.107 T:1945329664 DEBUG: Keyboard: scancode: 0x3e, sym: 0x011d, unicode: 0x0000, modifier: 0x0
15:16:35.507 T:1945329664 DEBUG: Previous line repeats 1 times.
15:16:35.507 T:1945329664 DEBUG: OnKey: f4 (0xf093) pressed, action is
15:16:35.551 T:1945329664 DEBUG: Keyboard: scancode: 0x3e, sym: 0x011d, unicode: 0x0000, modifier: 0x0
Display More
keyboard.xml (tried both <blue> and <f4> to get this working, but no luck)
<keymap>
<global>
<keyboard>
<blue>XBMC.RunScript(/storage/hyperion_switch.py)</blue>
</keyboard>
<keyboard>
<f4>XBMC.RunScript(/storage/hyperion_switch.py)</f4>
</keyboard>
</global>
</keymap>
hyperion_switch.py
#!/usr/bin/python
import sys
import subprocess
subprocess.call(["/storage/toggleHyperion.sh"], shell=True)
toggleHyperion.sh (what's being referenced in the above python script)