Help with hardware controls

  • Hi,

    My scenario:

    Using LibreElec for car stereo (all that working fine, for the purposes of this post).

    It should be noted, I have NO EXERIENCE tampering with controller/joystick .xml (I do know how to edit the files, however, with Notepad++). I am completely clueless about naming conventions within the files (containers, etc.).

    I want to add a button box for physical controls; driving and trying to hit a specific area of touchscreen is not an option; hard buttons (and vol/navigation knob) needed.

    I have two options to pursue, the first being easier and cleaner:


    A. I have a USB volume knob that works great to plug-in and control volume and mute.

    1. At the least, I want to change the behavior of the mute to "Play/Pause"
    2. Even better, I would change the behavior of the three functions VolUp, VolDown, Mute to change depending on screen: up/down/select when navigtating, volup/voldown/pause when player is on screen
    3. Even best, I would do the Even Better option, plus add LongPress and ExLongPress to mute (or stop) and 'back', respectively.
    4. Even bester, I would add "reboot" to ExtraSuperLongPress
    5. The joystick wiki talks about adding duration to press comands for LongPress "in the future". Has this been implemented? It seems to enable everything best and bester.
    6. Where do I locate the .xml for the volume knob? It's a plug-and-play USB knob, and I've needed to do no config to get it to work in Kodi for volume controls. I assume it's being used at the OS level, and if so, how do I get Kodi to recognize it as input
    7. I really like this option, if workable, as It gives me one single godknob, which is cleaner from a design standpoint. I have little real estate to attach hardware controls around the touchscreen on the dash. A single godknob is easy, space-wise. More knobs/buttons would necessitate having a remote box; doable, but longer to develop.

    Option B is a button-box based on a USB Zero Delay board.

    1. I'd love to be able to use rotary encoders with this board, one for volume and one for menu navigation, but am not sure this is possible. Probably going to cook the board figuring it out, and Google only has info on joysticks and buttons with this board, not rotary encoders (the board is advertised as an "encoder", so any searches with the term added don't understand to add Rotary Encoder as a need)
    2. When I plug the board into LibreElec, I don't see any indication that I've added a controller. Is there a generic controller profile (or better yet a Zero Delay profile) somewhere I can aquire?
    3. I also have a couple Leonardo (Pro Micro?) boards, but my initial stabs at configuration have been difficult to be recognized by Windows with MMJoy2. I haven't tried on Pi, as the setup is hard enough to get to navigate on a normal sized computer with GUI (unlike LibreElec).

    Any advice on the above?

    (I tried posting this in the Kodi > RPi forum but haven't gotten any response).

    Thanks in advance!

    Erik

  • I guess to simplify, this would be helpful:

    Where do I locate the .xml for the volume knob? It's a plug-and-play USB knob, and I've needed to do no config to get it to work in Kodi for volume controls. I assume it's being used at the OS level, and if so, how do I get Kodi to recognize it as input

    Thanks in advance,

    Erik

  • Where do I locate the .xml for the volume knob?

    You have to create a key mapping file. LE has default key mapping files.Those files are located at /usr/share/kodi/system/keymaps,

    They are read-only. You can overwrite any of these files by creating your own version at /storage/.kodi/userdata/keymaps.

    Read about key mapping details here: Click!

  • You have to create a key mapping file. LE has default key mapping files.Those files are located at /usr/share/kodi/system/keymaps,

    They are read-only. You can overwrite any of these files by creating your own version at /storage/.kodi/userdata/keymaps.

    Read about key mapping details here: Click!

    Ok, thank you; that's a step in the right direction. I'd read through the keymap wiki, but am unsure what my device is called at the OS level. I was hoping there was some way to find its ID, as it doesn't show up as "connected" anywhere?

  • You can use the usb-devices command, but I don't think it's helpful. There are not too many device classes in the keymaps folder, so I would trial-and-error to find the right XML.