Media/trick keys being blocked from Kodi
#16
(2018-01-04, 11:18)fritsch Wrote: lindend: Try just4fun using xmodmap as a test to map one of those to e.g. F8 - does it work now?
 when mapped to F8, Kodi consistently sees it.


^[^[12:27:01.521 T:139812437727616   DEBUG: Keyboard: scancode: 0xb0, sym: 0x0121, unicode: 0x0000, modifier: 0x0
12:27:18.139 T:139812437727616   DEBUG: Previous line repeats 1 times.
12:27:18.139 T:139812437727616   DEBUG: OnKey: f8 (0xf097) pressed, action is Mute
12:27:18.139 T:139812437727616   DEBUG: ------ Window Init (DialogVolumeBar.xml) ------
12:27:18.139 T:139811938690816   DEBUG: CAnnouncementManager - Announcement: OnVolumeChanged from xbmc
12:27:18.139 T:139812437727616   DEBUG: Keyboard: scancode: 0xb0, sym: 0x0121, unicode: 0x0000, modifier: 0x0
12:27:18.139 T:139811938690816   DEBUG: GOT ANNOUNCEMENT, type: 64, from xbmc, message OnVolumeChanged
12:27:18.788 T:139812437727616   DEBUG: Keyboard: scancode: 0xb0, sym: 0x0121, unicode: 0x0000, modifier: 0x0
12:27:41.642 T:139811752937216   DEBUG: Previous line repeats 1 times.
12:27:41.642 T:139811752937216   DEBUG: Failed to connect to LIRC. Giving up.
12:27:41.642 T:139811752937216   DEBUG: Thread RemoteControl 139811752937216 terminating
12:27:48.488 T:139812437727616   DEBUG: Keyboard: scancode: 0xb0, sym: 0x0121, unicode: 0x0000, modifier: 0x0
Reply
#17
Good. Then there is a workaround.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#18
Unfortunately, I think I spoke too soon.  Didn't test enough.  Changed the rewind key to 'r' and the FF key to 'f'.  xev reliably gets both events.  Kodi is unpredictable.  Sometimes the event is seen.  Most keypresses are missed.

Here's a snippet from the log when the keys are pressed

13:23:29.909 T:139923952785792   DEBUG: Keyboard: scancode: 0xd8, sym: 0x0066, unicode: 0x0000, modifier: 0x0
13:23:50.395 T:139923952785792   DEBUG: Keyboard: scancode: 0xd8, sym: 0x0066, unicode: 0x0066, modifier: 0x0
13:23:50.395 T:139923952785792   DEBUG: OnKey: f (0xf046) pressed, action is FastForward
13:23:50.395 T:139923952785792   DEBUG: Keyboard: scancode: 0xd8, sym: 0x0066, unicode: 0x0000, modifier: 0x0

When the OnKey is seen in the log, the trick key works.  Most often, I just see the scancode without the corresponding OnKey and nothing happens.
Reply
#19
Trying to see what the difference is between the success and failure cases.  When the key is processed, a see a non-zero Unicode value.  Is that relevant?
Reply
#20
Experimenting some more trying to figure out why KEY_PREVIOUS and KEY_NEXT aren't seen by xev or kodi while they are detected by ir-keytable.  I brought up the unifi keyboard shortcut settings.  It sees all the media keys except KEY_PREVIOUS and KEY_NEXT too.

Is there something that could be grabbing these keys before unifi shortcuts after ir-keytable sends them or could there be a bug with how ir-keytable is propagating these two events?
Reply
#21
Solved the next/previous issue.  After reading a bunch of threads, turns out those values are outside the range for X.  Modified the imod-pad keytable to use KEY_NEXTSONG and KEY_PREVIOUSSONG instead and they work perfectly in Kodi without any additional mapping (they also are detected by Unity).  Now just need to figure out why the rest of the media keys aren't detected reliably.
Reply
#22
I think I have a workaround.  Map the media keys at the ir-keytable level rather than with xmodmap.  With initial testing, this seems to work.

However, I'd still like to get to the bottom of what could be causing Kodi to miss media key presses whereas 'F', 'R', 'X' etc seem to work.
Reply
#23
If the device is not up before X starts, there might be no keys to receive as input is not properly registered with X?

In that case, would it work if you restart your xsession only?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#24
(2018-01-10, 22:06)fritsch Wrote: In that case, would it work if you restart your xsession only?
Unfortunately, restarting X didn't help.  xev and Unity (via the keyboard shortcuts) see the keypresses for the media keys, Kodi doesn't.  If I map them to conventional keyboard keys like 'f' and 'r' they work. 

Is it possible that somewhere I've got an XML configuration file that has a bad mapping for these keys?  I've looked and my keymaps directory is empty.  Don't see any other XML file that would be relevant.  Used to have a Lirc.xml but I've deleted that.  This is a new machine, but I did move XML files over from a Ubuntu 12 LTS machines running I believe Kodi 14.
Reply

Logout Mark Read Team Forum Stats Members Help
Media/trick keys being blocked from Kodi0