input devices not recognised by kodi - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166) +---- Thread: input devices not recognised by kodi (/showthread.php?tid=330353) |
input devices not recognised by kodi - JamesGKent - 2018-03-30 I'm currently trying to make a module to use a rotary encoder usable as a volume control on my raspberry pi by turning the increments into volume up/down buttons. the module I have made now works to adjust the volume on the raspbian desktop but not in kodi. I have enabled advanced input logging and the device is picked up by kodi the same as my physical keyboard is, but kodi does not recognise the input. I have tested this with evtest and even altered the code so that the reported capabilities, bus, VID and PID all match my physical keyboard and yet kodi still doesn't recognise any input from my device. I have also found the same behaviour with the gpio_keys driver that is part of raspbian. from logs, keyboard that works getting picked up: Code: 18:22:01.787 T:1910902784 INFO: Found input device /dev/input/event2 Code: 18:22:02.227 T:1910902784 INFO: Found input device /dev/input/event4 with the physical keyboard i get events like this: Code: 19:01:47.225 T:1911083008 DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0 could it be because my device and the gpio_keys drivers only implement keycodes and not scancodes? RE: input devices not recognised by kodi - JamesGKent - 2018-04-03 so i've raised a kodi bug report: here but from diving into the kodi source it looks like the issue is that if the device has less than 21 keys it is not assigned the LI_DEVICE_KEYBOARD type, and if it doesn't meet any other types criteria it falls through and is assigned LI_DEVICE_NONE, then in the event handler if the type is LI_DEVICE_NONE it returns without handling any events. the way the gpio-keys driver from the linux tree is written it only reports key capabilities for the keys that are registered with it, which would rarely be 21 or more. so this driver would pretty much always be ignored. i'd suggest it would be better to alter the fall through so that if no type is more applicable as long as it has at least 1 button it gets given the LI_DEVICE_KEYBOARD type. RE: input devices not recognised by kodi - JamesGKent - 2018-04-04 i have created a pull request to fix this issue here but in the mean time I've made an altered gpio-keys driver that declares extra keys to get around the kodi limitation here for anyone interested i have also make a kernel module to use a rotary encoder as a volume control here |