Forum

Full Version: Use a remote without LIRC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For reasons that would take too long to explain, I would like to use my remote control without LIRC. In "standard' Kodi installations, this is how I do it:

1. stop - uninstall LIRC

2. fix the rc_keymaps for the remote in question (MCE receiver with HP remote), so that it produces
known keycodes, in the 1-254 range

3. use Kodi's keymap editor to map the keycodes into actions.

This has always worked up to now, kodi handles the remote as if it is a keyboard.
All configuration is via the GUI, no manual editing of xml files involved.

In Xbian, this does not work, strangely. this is what I did :

1. set lirc service to not autostart and rebooted
2. created the rc6_mce file
3. tested with ir-keytable. the file works fine.
4. tested the remote on the command line, OS sees it as a keyboard.

so far, so good. BUT :

when I start Kodi, the log says it sees the device and opens it (/dev/input/event2), but Kodi does not recognize ANY keys from the remote. It is not a permissions issue, /dev/input/event2 can be read by group 'input', and 'xbian' belongs to the group. Enabling debug logging shows nothing, no events are recognized by Kodi.

what could be wrong ? why is Kodi ignoring the input, while the operating system (and any apps started from the command line) handles the remote just fine ?
I found the answer myself, and it is a beut!

kodi contains some (dangerous IMHO) code to "auto-detect" linux input devices, and decide whay to do with them. Apparently, a device is considered a "keyboard" if it can generate AT LEAST 20 ascii characters. In my case, the remote DOES simulate a keyboard, but not completely. Therefore, kodi decides to ignore it.

The workaround is this : when setting up the kernel keymap for an input device that generates keyboard events, add some "dummy" scancodes, to get the number of possible key events to be >20! silly, but works! and, since the remote will never actually send those scancodes, the workaround should not hurt...

One last note : keep the scancodes <255, and preferrably < 127, as kodi has these limits hard-wired
Reference URL's