I am using the very latest LibreELEC which is Kodi 17.0-RC3 Git 4d93228, compiled Jan 16 2017. I have literally just done a clean installation in the last 10 minutes. So far I have run this command (ignore the LibreLaptop name; I'm just using a laptop to test while at work):
LibreLaptop:~ # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event11) with:
Driver mceusb, table rc-rc6-mce
Supported protocols: unknown other lirc rc-5 jvc sony nec sanyo mce-kbd rc-6 sharp xmp
Enabled protocols: lirc nec rc-6
Name: Media Center Ed. eHome Infrared
bus: 3, vendor/product: 147a:e03e, version: 0x1001
Repeat delay = 1000 ms, repeat period = 125 ms
LIRC, NEC and RC-6 are clearly the only enabled protocols. Since I just need RC-5, I can run this command:
ir-keytable -p rc-5
Protocols changed to rc-5
Now on Kodibuntu this command literally enables RC-5 and NOTHING else. But on LibreELEC, if I query IR-KEYTABLE now I get:
LibreLaptop:~ # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event11) with:
Driver mceusb, table rc-rc6-mce
Supported protocols: unknown other lirc rc-5 jvc sony nec sanyo mce-kbd rc-6 sharp xmp
Enabled protocols: lirc rc-5
Name: Media Center Ed. eHome Infrared
bus: 3, vendor/product: 147a:e03e, version: 0x1001
Repeat delay = 1000 ms, repeat period = 125 ms
LibreLaptop:~ #
Clearly, LIRC is still being used and I think this is the reason why my IR keyboard commands are being dropped. If I check the Kodi log file, I can see key presses from the laptop's keyboard.
At this point, since I haven't yet run "systemctl stop eventlircd.service", if I try to test for key presses in IR-KEYTABLE, it doesn't see anything. If I then run the command to stop the LIRCD service, I see this in the Kodi log:
LibreLaptop:~ # ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event11) with:
Driver mceusb, table rc-rc6-mce
Supported protocols: unknown other lirc rc-5 jvc sony nec sanyo mce-kbd rc-6 sharp xmp
Enabled protocols: lirc rc-5
Name: Media Center Ed. eHome Infrared
bus: 3, vendor/product: 147a:e03e, version: 0x1001
Repeat delay = 1000 ms, repeat period = 125 ms
This is what makes me think LIRC and LIRCD are completely separate, and stopping the LIRC service (even though it says LIRC disconnected in Kodi's log) does not actually shut down LIRC. After this, IR-KEYTABLE starts responding to IR commands:
LibreLaptop:~ # ir-keytable -t
Testing events. Please, press CTRL-C to abort.
1485446427.304544: event type EV_MSC(0x04): scancode = 0x1b46
1485446427.304544: event type EV_SYN(0x00).
1485446428.055559: event type EV_MSC(0x04): scancode = 0x1b46
1485446428.055559: event type EV_SYN(0x00).
1485446428.823524: event type EV_MSC(0x04): scancode = 0x1b47
1485446428.823524: event type EV_SYN(0x00).
1485446429.304563: event type EV_MSC(0x04): scancode = 0x1b47
1485446429.304563: event type EV_SYN(0x00).
Since I haven't created / loaded a keytable in this fresh install of LibreELEC, clearly the scancodes are not mapped to any key presses. I can quickly write a keytable for the most common commands (/storage/.kodi/userdata/keymaps/prontotest.cfg):
#table pronto, type: rc-5
0x1b46 KEY_UP
0x1b47 KEY_DOWN
0x1b48 KEY_LEFT
0x1b49 KEY_RIGHT
0x1b3a KEY_ENTER
0x1b1a KEY_C
0x1b5c KEY_BACKSPACE
Now if I load this keytable into IR-KEYTABLE:
LibreLaptop:~ # ir-keytable -c -w /storage/.kodi/userdata/keymaps/prontotest.cfg
Read pronto table
Old keytable cleared
Wrote 7 keycode(s) to driver
Protocols changed to rc-5
The keys are successfully written to the table, and a test proves they work under IR-KEYTABLE:
LibreLaptop:~ # ir-keytable -t
Testing events. Please, press CTRL-C to abort.
1485447405.921146: event type EV_MSC(0x04): scancode = 0x1b46
1485447405.921146: event type EV_KEY(0x01) key_down: KEY_UP(0x0001)
1485447405.921146: event type EV_SYN(0x00).
1485447406.175542: event type EV_KEY(0x01) key_up: KEY_UP(0x0001)
1485447406.175542: event type EV_SYN(0x00).
1485447406.839166: event type EV_MSC(0x04): scancode = 0x1b47
1485447406.839166: event type EV_KEY(0x01) key_down: KEY_DOWN(0x0001)
1485447406.839166: event type EV_SYN(0x00).
1485447407.108890: event type EV_KEY(0x01) key_up: KEY_DOWN(0x0001)
1485447407.108890: event type EV_SYN(0x00).
1485447407.715136: event type EV_MSC(0x04): scancode = 0x1b48
1485447407.715136: event type EV_KEY(0x01) key_down: KEY_LEFT(0x0001)
1485447407.715136: event type EV_SYN(0x00).
1485447407.988900: event type EV_KEY(0x01) key_up: KEY_LEFT(0x0001)
1485447407.988900: event type EV_SYN(0x00).
1485447408.636120: event type EV_MSC(0x04): scancode = 0x1b49
1485447408.636120: event type EV_KEY(0x01) key_down: KEY_RIGHT(0x0001)
1485447408.636120: event type EV_SYN(0x00).
1485447408.895542: event type EV_KEY(0x01) key_up: KEY_RIGHT(0x0001)
1485447408.895542: event type EV_SYN(0x00).
1485447410.135152: event type EV_MSC(0x04): scancode = 0x1b3a
1485447410.135152: event type EV_KEY(0x01) key_down: KEY_ENTER(0x0001)
1485447410.135152: event type EV_SYN(0x00).
1485447410.388908: event type EV_KEY(0x01) key_up: KEY_ENTER(0x0001)
1485447410.388908: event type EV_SYN(0x00).
1485447412.036138: event type EV_MSC(0x04): scancode = 0x1b5c
1485447412.036138: event type EV_KEY(0x01) key_down: KEY_BACKSPACE(0x0001)
1485447412.036138: event type EV_SYN(0x00).
1485447412.308914: event type EV_KEY(0x01) key_up: KEY_BACKSPACE(0x0001)
1485447412.308914: event type EV_SYN(0x00).
1485447413.577152: event type EV_MSC(0x04): scancode = 0x1b1a
1485447413.577152: event type EV_KEY(0x01) key_down: KEY_C(0x0001)
1485447413.577152: event type EV_SYN(0x00).
1485447413.828886: event type EV_KEY(0x01) key_up: KEY_C(0x0001)
1485447413.828886: event type EV_SYN(0x00).
Display More
Here is where I am stuck. The above keys clearly work in IR-KEYTABLE and all except KEY_C are passed to Kodi without issue. I can navigate up, down, left and right through menus, select options, and return (KEY_BACKSPACE) to the previous menu. I just can't launch the Context Menu on KEY_C. Kodi logs the keys like this:
16:21:31.519 T:139809499108608 DEBUG: OnKey: up (0xf080) pressed, screen saver/dpms woken up
16:21:31.519 T:139809499092736 DEBUG: CAnnouncementManager - Announcement: OnScreensaverDeactivated from xbmc
16:21:31.519 T:139809499092736 DEBUG: GOT ANNOUNCEMENT, type: 4, from xbmc, message OnScreensaverDeactivated
16:21:31.785 T:139809499108608 DEBUG: Keyboard: scancode: 0x6f, sym: 0x0111, unicode: 0x0000, modifier: 0x0
16:21:32.549 T:139809499108608 DEBUG: ------ Window Deinit () ------
16:21:33.130 T:139809499108608 DEBUG: Keyboard: scancode: 0x74, sym: 0x0112, unicode: 0x0000, modifier: 0x0
16:21:33.131 T:139809499108608 DEBUG: OnKey: down (0xf081) pressed, action is Down
16:21:33.378 T:139809499108608 DEBUG: Keyboard: scancode: 0x74, sym: 0x0112, unicode: 0x0000, modifier: 0x0
16:21:34.242 T:139809499108608 DEBUG: Keyboard: scancode: 0x71, sym: 0x0114, unicode: 0x0000, modifier: 0x0
16:21:34.242 T:139809499108608 DEBUG: OnKey: left (0xf082) pressed, action is Left
16:21:34.508 T:139809499108608 DEBUG: Keyboard: scancode: 0x71, sym: 0x0114, unicode: 0x0000, modifier: 0x0
16:21:35.338 T:139809499108608 DEBUG: Keyboard: scancode: 0x72, sym: 0x0113, unicode: 0x0000, modifier: 0x0
16:21:35.338 T:139809499108608 DEBUG: OnKey: right (0xf083) pressed, action is Right
16:21:35.604 T:139809499108608 DEBUG: Keyboard: scancode: 0x72, sym: 0x0113, unicode: 0x0000, modifier: 0x0
16:21:37.628 T:139809499108608 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
16:21:37.894 T:139809499108608 DEBUG: OnKey: return (0xf00d) pressed, action is Select
16:21:37.894 T:139809499108608 DEBUG: ------ Window Init (DialogMediaSource.xml) ------
16:21:39.301 T:139809499108608 DEBUG: Keyboard: scancode: 0x16, sym: 0x0008, unicode: 0x0008, modifier: 0x0
16:21:39.301 T:139809499108608 DEBUG: OnKey: backspace (0xf008) pressed, action is Back
16:21:39.584 T:139809499108608 DEBUG: ------ Window Deinit (DialogMediaSource.xml) ------
16:21:39.585 T:139809499108608 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0
16:21:39.585 T:139809499108608 DEBUG: Keyboard: scancode: 0x16, sym: 0x0008, unicode: 0x0000, modifier: 0x0
Display More
As you can see, the KEY_C scancode is ignored by Kodi. I am convinced LIRC is the cause of this.
I think LIRC is translating the navigation keys as they are a common standard, but since LIRC is not designed for use with keyboards, it doesn't know what KEY_C (or KEY_A, KEY_W, etc) is so it can't map it to a command that it understands, to then pass to Kodi... Therefor it just drops the command so Kodi doesn't see anything.
There must be a way of completely disabling LIRC either at LibreELEC boot time or by issuing a command to IR-KEYTABLE to tell it not to listen to LIRC!