Using keyboard LEDs

  • My (intel based) libreelec has custom case, made from old deck. I have two leds there, which I want to use (PLAY and RECORD).
    The best way in my opinion is to use typical keyboard LEDs - NUMLOCK and SCROLLOCK.

    Some thoughts:

    - I drive my libreelec with MCE Remote or with keyboard which doesn't have such keys, so this is ok on this side

    - In the case there is keyboard controller with the leds (to control other buttons on front of case), so technically connecting is trivial

    - Callbacks addon may do the job (turn on PLAY led, when something is playing; not sure what to do with the other led yet :) ), when I solve the last one thing:

    - I cannot find a way to turn on/off the leds (or just press the keys virtually). All the ways found in the net are not available on libreelec (xdotool, xset and others)

    Is it possible to turn on/off the leds?

  • Then use binary I build.

    Code
    mkdir -p /storage/.kodi/addons/xdotool/lib
    mkdir -p /storage/.kodi/addons/xdotool/bin
    cd /storage/.kodi/addons/xdotool
    wget -O xdotool_x86_64.tgz http://vpeter.libreelec.tv/tmp/xdotool_x86_64.tgz
    tar xvzf xdotool_x86_64.tgz
    mv libxkbcommon.so.0 lib
    mv xdotool bin
    rm xdotool_x86_64.tgz
    # log out adn log back in
  • Thank you.

    Unfortunately it does not work in this case - of course switching Num_Lock works, but I cannot determine current LED/key status and --clearmodifiers option does not work here, it clears only Caps_Lock.

    Fortunately - xset (with libXmuu) just copied from my Mint desktop works

    xset q | grep Num

    00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off

    and xset led named "Scroll Lock" works for Scroll_Lock (only for that).

    So I will use xset for status and xdotools for setting Num_Lock and xset only for Scroll_Lock. So - problem solved actually