Power button sends device to suspend, ignoring power menu

  • Hi,

    I recently upgraded to LE 12.0 nightly 20240713 amd64 legacy.

    Before I was running 12.0 non-legacy, but had some issues.

    The device is a HP SFF with a Ryzen 3400G.

    Before the update the power menu showed when I pressed the power button in my Orbsmart AM1 remote (which shows up as keyboard and mouse).

    Now the device immediately goes into suspend without the possibility to select something from the power menu, but the menu is shown after resuming.

    Also the network is not working after resume, so I have to reboot again.

    This is super annoying if I accidentally press the power button on the remote or just wanting to power it off.

    I tried adding <power>noop</power> in the keyboard section of my keyboard.xml without any change in behaviour...


    How can I get back to the old behaviour or disable suspend for good?

    Thanks in advance,

    Peter

  • You can change the power button behavior by key mapping. Create a keyboard.xml file. Example:

    Da Flex
    August 17, 2019 at 11:58 AM
  • You can change the power button behavior by key mapping. Create a keyboard.xml file.

    I tried adding <power>noop</power> in the keyboard section of my keyboard.xml without any change in behaviour...

    Are you serious? As I already stated, that had no effect at all.

    Here's the contents of my keymap:

  • On Generic legacy kodi (actually X11) doesn't grab the input devices so logind will "see" power/suspend/hibernate button presses and handle them.

    The login power button handling is set to "ignore" in Generic Legacy but if your remote sends KEY_SLEEP (=suspend to ram) or KEY_SUSPEND (=hibernate) logind will put your system to sleep.

    You can change that behavior by creating a /storage/.config/logind.conf.d/disable-suspend.conf file with the following contents and reboot:

    Code
    [Login]
    HandleSuspendKey=ignore
    HandleHibernateKey=ignore

    Now logind will ignore those buttons and you can configure the desired behaviour in kodi.

    so long,

    Hias

  • You can change that behavior by creating a /storage/.config/logind.conf.d/disable-suspend.conf file with the following contents and reboot:

    Code
    [Login]
    HandleSuspendKey=ignore
    HandleHibernateKey=ignore

    Thank you so much HiassofT, that did the trick!

    Meanwhile I only manged to stop the power menu from showing by also adding <sleep>noop</sleep> to my keymap, which was not my goal...

    And changing the tag to remote stopped the keymap from working, the correct tag for my device is definitely keyboard.

    But thank you too for your advice Da Flex, I really appreciate it.

    Peter