My keyboard.xml isn't running the assigned key's command

  • 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

    keyboard.xml (tried both <blue> and <f4> to get this working, but no luck)

    Code
    <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

    Python
    #!/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)

    Bash
    #!/bin/sh
    if ps | grep -v grep | grep hyperiond > /dev/null
    then
      killall hyperiond  > /dev/null &
    else
    /storage/.config/autostart.sh > /dev/null 2>&1 &
    #reboot
    #/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /dev/null 2>&1 &
    fi
  • FFS - my keyboard.xml syntax was wrong. One too many <keyboard< </keyboard> brackets.

    All is well in the world!


    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <keyboard>
            <f4>XBMC.RunScript(/storage/hyperion_switch.py)</f4>
        </keyboard>
      </global>
    </keymap>