SCRACTCH EVERYTHING I SAID BEFORE
This is starting to look like a monologue... But I hope it is helpful to some...
In some thread I found that the XBOX One remote is actually supported by default under OpenELEC since 4.0.x. In this case, you don't need a lircd.conf.
You can check if that's the case for your version by having a look at the rc6_mce keymap by:
Code:
less /etc/rc_keymaps/rc6_mce
at the bottom of the file, you should find sth like that:
Code:
#XBOX One Remote (Protocol: NEC)
0x80d864 KEY_MEDIA
0x80d820 KEY_LEFT
0x80d821 KEY_RIGHT
0x80d81e KEY_UP
0x80d81f KEY_DOWN
0x80d822 KEY_OK
0x80d823 KEY_EXIT
0x80d80e KEY_MUTE
0x80d810 KEY_VOLUMEUP
0x80d811 KEY_VOLUMEDOWN
0x80d812 KEY_CHANNELUP
0x80d813 KEY_CHANNELDOWN
0x80d814 KEY_FASTFORWARD
0x80d815 KEY_REWIND
0x80d870 KEY_PLAYPAUSE
0x80d819 KEY_STOP
0x80d81a KEY_NEXT
0x80d81b KEY_PREVIOUS
0x80d826 KEY_INFO
0x80d86f KEY_EPG
0x80d86e KEY_ZOOM
Next, make sure you
DON'T modify the lircd config through the autostart.sh. If you don't have anything else in this file, you can safely delete it. This is my autostart.sh now:
Code:
#!/bin/sh
# turn off the red LED on the Cubox
echo "0" > /sys/class/leds/imx6\:red\:front/brightness
Don't add this line if you don't have a Cubox or have a Cubox and like bright red LEDs. Although you can adjust the brightness between 0-248. But I'm diverting...
After a reboot ir-keytable gives me the following:
Code:
OpenELEC:~ # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event0) with:
Driver gpio-rc-recv, table rc-rc6-mce
Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
Enabled protocols: NEC RC-6
Repeat delay = 200 ms, repeat period = 125 ms
Note that the
NEC protocol is enabled, which is apparently used by the XBOX One remote.
You can still use the Lircmap.xml to map the buttons from the keymap to the functions you like. Make sure to use the new device name. It is most likely
devinput. You can find it out by using irw and using the label that is given after a key press.
Code:
OpenELEC:~ # irw
6a 0 KEY_RIGHT devinput
Your Lircmap.xml should start like that then:
Code:
<lircmap>
<remote device="devinput">
Overall this works much much nicer than my hackish approach before. Maybe this post should be updated to reflect the support by default?