How to change a single key mapping?

I would like to change the behaviour of the long press Home button on the Home screen. From ‘Send CEC standby’ to ‘System Suspend’.

I read the Long Press Keymap Guide. It explains how to create my own keymap from scratch. But that seems like a lot of work for just changing one key mapping.

Is there a way to copy the existing keymap, and then change this one button?
(This is on Vero 4K+ of december 2020).

The keymaps load in order combining the mappings in them with user keymaps loading after the system keymaps. When it loads each keymap if there is a conflict it overrides the mapping. As such, all that is required is to place your desired modifications to the user thumbnails. In your case this would be…

<keymap>
	<Home>
		<keyboard>
			<escape mod="longpress">suspend</escape>
		</keyboard>
	</Home>
</keymap>

But I’m not sure if this is actually the correct action. The keymap wiki seems to indicate that this is a trigger for sleep states on a PC and the correct action to use would be “shutdown” which would have its actual function dictated by what is set in Kodi’s power saving settings.

1 Like

Thanks you were spot on. Adding the steps for other noobs like me:

  1. Open a command line through Putty / SSL
  2. nano /home/osmc/.kodi/userdata/keymaps/osmc/osmcremote.xml
  3. Copy & paste: (afterwards Ctrl+X and Y + Enter)
<keymap>
  <Home>
    <keyboard>
      <escape mod="longpress">ShutDown</escape>
    </keyboard>
  </Home>
</keymap>
  1. In Kodi GUI navigate to Settings > System > Power saving > Default shutdown method. Change to ‘Suspend’.

Cheers, but for reasons I outlined in that guide I would actually recommend saving the keymap to…

/home/osmc/.kodi/userdata/keymaps/osmc/osmcremote.xml

Thanks, I edited my post.

1 Like