I'm trying to map a some extra buttons using the XML keymap method, but it's not working correctly.
I'm running LibreELEC 19.5 on a Raspberry Pi 3B.
I'm starting with just trying to get two buttons working. I want the 1 and 3 on my IR remote to do a seek(-15) and seek(15) respectively. I have managed to achieve this, but every alternate button press it registers as a Number1 or Number3 action, so you have to press the button twice each time. And I can't find where this is coming from. When I mapped button 4 whilst I've been testing this all day, it alternated that one with JumpSMS action. Maybe that can help diagnose what's causing this to happen.
I know for this example, I probably can do this in a simpler way. But this is only a simple test for me to learn how to do it. I eventually want to map more complex keymaps which will require this keymapping method.
I'm using an IR receiver which might be where my issue stems from.
To begin, I've set up my IR and have my IR codes mapped in /storage/.config/rc_keymaps/samsung_remote and looks like this:
# table samsung_remote, type: nec
0x70704 KEY_1
0x70706 KEY_3
I'm leaving out the other key binds that work fine. The problem is caused by what I must have done incorrectly later.
Then I created Lircmap.xml in ~/.kodi/userdata which looks like so:
<?xml version="1.0" encoding="UTF-8"?>
<lircmap>
<remote device="devinput">
<one>KEY_1</one>
<three>KEY_3</three>
</remote>
</lircmap>
And I also create a file called remote.xml in ~/.kodi/userdata/keymaps which looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<global>
<remote>
<one>seek(-15)</one>
<three>seek(15)</three>
</remote>
</global>
</keymap>
I rebooted to apply the changes.
When I run irw I get
2 0 KEY_1 devinput
4 0 KEY_3 devinput
for the two keys.
I have my kodi in debug mode and can see when I press the 1 button, I get:
2023-02-03 02:20:32.936 T:625 DEBUG <general>: LIRC: - NEW 2 0 KEY_1 devinput (KEY_1)
2023-02-03 02:20:32.943 T:614 DEBUG <general>: HandleKey: 206 (0xce, obc49) pressed, action is Number1
2023-02-03 02:20:33.409 T:625 DEBUG <general>: LIRC: - NEW 2 0 KEY_1 devinput (KEY_1)
2023-02-03 02:20:33.410 T:614 DEBUG <general>: HandleKey: 206 (0xce, obc49) pressed, action is seek(-15)
And for the 3 button:
2023-02-03 02:11:30.639 T:625 DEBUG <general>: LIRC: - NEW 4 0 KEY_3 devinput (KEY_3)
2023-02-03 02:11:30.643 T:614 DEBUG <general>: HandleKey: 204 (0xcc, obc51) pressed, action is Number3
2023-02-03 02:11:31.186 T:625 DEBUG <general>: LIRC: - NEW 4 0 KEY_3 devinput (KEY_3)
2023-02-03 02:11:31.193 T:614 DEBUG <general>: HandleKey: 204 (0xcc, obc51) pressed, action is seek(15)
As you can see the button alternates between the two actions. But I can't understand what's mapping it to Number 1 or Number 3.
I have Keybind Editor installed and the ~/.kodi/userdata/keymaps/gen.xml looks like this:
<keymap>
<fullscreenvideo>
<keyboard>
<key id="216">stop</key>
</keyboard>
</fullscreenvideo>
<global>
<keyboard>
<key id="251">contextmenu</key>
</keyboard>
</global>
</keymap>
Display More
So I'm sure it's not coming from there. Those are the 'exit' and 'red' buttons on my remote.
As a final test, I've removed both the remote.xml and the Lircmap.xml and the action is only the Number 1 / Number 3. So it must be coming from somewhere else. I don't really know why I explained everything I did because maybe I didn't do anything wrong in what I added, I just need to find what I didn't change that I should have.
There is the Lircmap.xml in /usr/share/kodi/system but this is unwritable and I thought that creating the one I created was meant to override that one. I don't know why I'm suggesting things, I haven't got a clue.
What is causing the two actions to be mapped to same key?
If anyone knows how I can fix this, that would be much appreciated.