Keymap.xml and meson-ir

My hardware is a Odroid N2 using a popcorn A-300 remote that was mapped using meson-ir using this guide:
how-to-configure-ir-remote

I would like to map a button to reboot, so I have the following line in my map file:
0x4cb5b KEY_F4
I picked KEY_F4 randomly from this list here

Now I am trying to use a keymap.xml to use F4 for reboot command. Running ir-keytable and pressing the mapped button/key the output is:

3949.763677: event type EV_MSC(0x04): scancode = 0x4cb5b
3949.763677: event type EV_KEY(0x01) key_down: KEY_F4(0x003e)
3949.763677: event type EV_SYN(0x00).
3949.774843: event type EV_MSC(0x04): scancode = 0x4cb5b
3949.774843: event type EV_SYN(0x00).
3949.900031: event type EV_MSC(0x04): scancode = 0x4cb5b
3949.900031: event type EV_SYN(0x00).
3950.156020: event type EV_KEY(0x01) key_up: KEY_F4(0x003e)
3950.156020: event type EV_SYN(0x00).

My current keymap.xml:

> <keymap>
>   <global>
>     <keyboard>
> 	  <key id="3e">reboot</key>
>     </keyboard>
>   </global>
> </keymap>

With logging on and pressing my newly “mapped” key, I get the following in the kodi.log:

.197 T:3987731328 DEBUG: LIRC: - NEW 3e 0 KEY_F4 devinput (KEY_F4)
.240 T:4064395280 DEBUG: HandleKey: 0 (0x00, obc255) pressed, action is
.415 T:3987731328 DEBUG: LIRC: - NEW 3e 0 KEY_F4 devinput (KEY_F4)
.456 T:4064395280 DEBUG: HandleKey: 0 (0x00, obc255) pressed, action is
.755 T:3987731328 DEBUG: LIRC: - NEW 161 0 KEY_SELECT devinput (KEY_SELECT)
.764 T:4064395280 DEBUG: HandleKey: 11 (0x0b, obc244) pressed, action is Select
.764 T:4064395280 NOTICE: Disabled debug logging due to GUI setting. Level 0.
.764 T:4064395280 NOTICE: Log level changed to “LOG_LEVEL_NORMAL”

It appears there is no action for KEY_F4. How can I get KEY_F4 recognized as an action? Is there a sublist of valid commands from this key list?

Try with

<f4>reboot</f4>

Rebooting from menu is too annoying?

Keymap editor addon allows you to choose reboot from the standard functions. Using some random key is a good idea because some of the key functions are reserved and do not map normally.

Shoog

I tried:
<f4>reboot</f4>
in place of:
<key id="3e">reboot</key>

Still does not work. Any more suggestions?

I would like to be able to reboot if Kodi gets locked up.

And how do you think Kodi could process the key if Kodi itself is not responding? :slight_smile:

You would need some external program listening for a key. In the old days I was using irexec but not sure what is the status on Amlogic devices.