2018-03-30, 20:05
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:
my device:
with the physical keyboard i get events like this:
could it be because my device and the gpio_keys drivers only implement keycodes and not scancodes?
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
18:22:01.787 T:1910902784 INFO: opened device 'Microsoft Microsoft® 2.4GHz Transceiver v6.0' (file name /dev/input/event2), m_bSkipNonKeyEvents 0
18:22:01.787 T:1910902784 WARNING: no keymap support (requires /dev/tty0 - CONFIG_VT)
Code:
18:22:02.227 T:1910902784 INFO: Found input device /dev/input/event4
18:22:02.227 T:1910902784 INFO: opened device 'GPIO Rotary Encoder Volume' (file name /dev/input/event4), m_bSkipNonKeyEvents 0
18:22:02.227 T:1910902784 WARNING: no keymap support (requires /dev/tty0 - CONFIG_VT)
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
19:01:47.225 T:1911083008 DEBUG: OnKey: long-volume_up (0x100f0b9) pressed, action is VolumeUp
19:01:47.225 T:1911079680 DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
19:01:47.226 T:1911079680 DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
19:01:47.310 T:1911083008 DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0
19:01:47.310 T:1911083008 DEBUG: OnKey: long-volume_up (0x100f0b9) pressed, action is VolumeUp
19:01:47.311 T:1911079680 DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
19:01:47.311 T:1911079680 DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
19:01:47.391 T:1911083008 DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0
19:01:47.391 T:1911083008 DEBUG: OnKey: long-volume_up (0x100f0b9) pressed, action is VolumeUp
19:01:47.392 T:1911079680 DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
19:01:47.392 T:1911079680 DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
19:01:47.471 T:1911083008 DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0
19:01:47.471 T:1911083008 DEBUG: OnKey: long-volume_up (0x100f0b9) pressed, action is VolumeUp
19:01:47.472 T:1911079680 DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
19:01:47.472 T:1911079680 DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
19:01:47.554 T:1911083008 DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0
19:01:47.554 T:1911083008 DEBUG: OnKey: long-volume_up (0x100f0b9) pressed, action is VolumeUp
19:01:47.555 T:1911079680 DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
19:01:47.555 T:1911079680 DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
19:01:47.600 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?