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?

  • I didn't do such things yet. Is there any documentation how to build it for libreelec and how to install?

  • Then use binary I build.

    1. mkdir -p /storage/.kodi/addons/xdotool/lib
    2. mkdir -p /storage/.kodi/addons/xdotool/bin
    3. cd /storage/.kodi/addons/xdotool
    4. wget -O xdotool_x86_64.tgz
    5. tar xvzf xdotool_x86_64.tgz
    6. mv lib
    7. mv xdotool bin
    8. rm xdotool_x86_64.tgz
    9. # log out adn log back in

    Better support for Amlogic devices: use CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)

  • 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