I just got into coreelec and I wanted to get a roku IR remote working because it’s my personal favorite. It’s kind of an odd case though, because instead of having one command code per button, it actually has two. When you tap a button (as in press and immediately release) let’s say it sends 0x01. That’s all well and good. But when you hold a button, even for just a fraction of a second, it sends out 0x01 first…and then instead of constantly sending 0x01, it does the same but for 0x81, the same command but with the MSB set high. If pressing a button sent one command, and holding a button sent a different command, things would be fine, since you can just map multiple commands to the same event. But after doing that, since it’s always gonna send out 0x01 before the stream of 0x81, it registers as you pressing the button once, then immediately releasing before pressing and holding again. Really nasty. Take a look.
677.925248: event type EV_MSC(0x04): scancode = 0xeac72a
677.925248: event type EV_KEY(0x01) key_down: KEY_ENTER(0x001c)
677.925248: event type EV_SYN(0x00).
678.033119: event type EV_KEY(0x01) key_up: KEY_ENTER(0x001c)
678.033119: event type EV_MSC(0x04): scancode = 0xeac7aa
678.033119: event type EV_KEY(0x01) key_down: KEY_ENTER(0x001c)
678.033119: event type EV_SYN(0x00).
678.141031: event type EV_MSC(0x04): scancode = 0xeac7aa
678.141031: event type EV_SYN(0x00).
678.248924: event type EV_MSC(0x04): scancode = 0xeac7aa
678.248924: event type EV_SYN(0x00).
678.356861: event type EV_MSC(0x04): scancode = 0xeac7aa
678.356861: event type EV_SYN(0x00).
678.552037: event type EV_MSC(0x04): scancode = 0xeac7aa
678.552037: event type EV_SYN(0x00).
678.812025: event type EV_KEY(0x01) key_up: KEY_ENTER(0x001c)
678.812025: event type EV_SYN(0x00).
This is holding down the OK (enter) button for a second or so. I know about the remote wakeup mask. I don’t know what it does. But if anyone knows how to apply a mask to every scancode and exclude the MSB(s), that should solve the problem completely. Oh, and here’s my toml if you’re curious.
[[protocols]]
name = "Roku TV Remote"
protocol = "nec"
variant = "necx"
[protocols.scancodes]
0xeac717 = "KEY_POWER"
0xeac766 = "KEY_BACK"
0xeac703 = "KEY_HOME"
0xeac719 = "KEY_UP"
0xeac733 = "KEY_DOWN"
0xeac71e = "KEY_LEFT"
0xeac72d = "KEY_RIGHT"
0xeac72a = "KEY_ENTER"
0xeac778 = "KEY_RESTART"
0xeac761 = "KEY_CONTEXT_MENU"
0xeac734 = "KEY_REWIND"
0xeac74c = "KEY_PLAYPAUSE"
0xeac755 = "KEY_FASTFORWARD"
0xeac70f = "KEY_VOLUMEUP"
0xeac710 = "KEY_VOLUMEDOWN"
0xeac720 = "KEY_MUTE"
0xeac752 = "KEY_PROG1"
0xeac706 = "KEY_PROG2"
0xeac74d = "KEY_PROG3"
0xeac76c = "KEY_PROG4"
0xeac797 = "KEY_POWER"
0xeac7e6 = "KEY_BACK"
0xeac783 = "KEY_HOME"
0xeac799 = "KEY_UP"
0xeac7b3 = "KEY_DOWN"
0xeac79e = "KEY_LEFT"
0xeac7ad = "KEY_RIGHT"
0xeac7aa = "KEY_ENTER"
0xeac7f8 = "KEY_RESTART"
0xeac7e1 = "KEY_CONTEXT_MENU"
0xeac7b4 = "KEY_REWIND"
0xeac7cc = "KEY_PLAYPAUSE"
0xeac7d5 = "KEY_FASTFORWARD"
0xeac78f = "KEY_VOLUMEUP"
0xeac790 = "KEY_VOLUMEDOWN"
0xeac7a0 = "KEY_MUTE"
0xeac7d2 = "KEY_PROG1"
0xeac786 = "KEY_PROG2"
0xeac7cd = "KEY_PROG3"
0xeac7dc = "KEY_PROG4"
if this functionality doesn’t exist at all I think I’ll have to learn what a BPF is