Howto change key press to longkeypress for remote

  • Hi,

    I'm running LibreELEC 7 with Kodi 16.1 that has the new feature for long pressing keys. I'm fine with the default configuration for my remote in LibreELEC/Kodi except the shutdown key. I want to change only this key behaviour to shutdown LibreELEC if the key is pressed for a longer time.

    For that I created a file /storage/.kodi/userdata/keymaps/remote.xml with

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <remote>
          <power mod="longpress">ShutDown()</power>
        </remote>
      </global>
    </keymap>


    and rebooted the machine.
    Unfortunately Kodi still shuts down after one short key press on the power button. lirc (irw) detects the key KEY_POWER.
    Is there still something missing that my configuration does not overwrite the default configuration for the power button?

    Thanks!


  • Hi,

    I'm running LibreELEC 7 with Kodi 16.1 that has the new feature for long pressing keys. I'm fine with the default configuration for my remote in LibreELEC/Kodi except the shutdown key. I want to change only this key behaviour to shutdown LibreELEC if the key is pressed for a longer time.

    For that I created a file /storage/.kodi/userdata/keymaps/remote.xml with

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <remote>
          <power mod="longpress">ShutDown()</power>
        </remote>
      </global>
    </keymap>


    and rebooted the machine.
    Unfortunately Kodi still shuts down after one short key press on the power button. lirc (irw) detects the key KEY_POWER.
    Is there still something missing that my configuration does not overwrite the default configuration for the power button?

    Thanks!


    You've not overwritten the power button's settings, you've just added a new one for a long press.
    Maybe:

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <remote>
          <power mod="longpress">ShutDown()</power>
          <power>noop</power>
        </remote>
      </global>
    </keymap>


    where 'noop' is 'no action'.

  • Thank you very much for your hint. This disables the power button but does not enable longpress for power.
    But if you change it to

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <remote>
          <power>noop</power>
          <power mod="longpress">ShutDown()</power>
        </remote>
      </global>
    </keymap>


    then it is working! So first disable the old function, then add a new one.

    Best


  • Thank you very much for your hint. This disables the power button but does not enable longpress for power.
    But if you change it to

    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <global>
        <remote>
          <power>noop</power>
          <power mod="longpress">ShutDown()</power>
        </remote>
      </global>
    </keymap>

    then it is working! So first disable the old function, then add a new one.

    Best


    Good spot, and that makes sense.