Kodi Community Forum

Full Version: Keyboard, media keys and XBMC : explanation needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am using XBMC/Linux since 2 years now, and everything runs perfectly. Up to now, my system was controlled with a IR remote managed by LIRC.
I got recently a "Logitech Dinovo Mini" keyboard and i am trying to use it inside XBMC, but i am facing issues with media keys (an i guess those issues are not linked to the device itself but more to the key recognition on XBMC).

The facts :
- I am using the Dinovo Mini with the dongle provided by Logitech : the device is recognized as 2 USBHID devices (ie mouse + keyboard).
- The keyboard is working perfectly in XBMC (arrows, enter, letters, ..., ...)
- But the media keys are not recognized properly.

My tests :
- In order to see what keycodes are generated, i activated the debug option in XBMC.
- Then for each media keys, i look in the xbmc.log
- Then for the media key "VolumeDown", i get the following lines :
Code:
10:39:55 T:139655830136896 M:3575820288   DEBUG: SDLKeyboard: scancode: 122, sym: 0, unicode: 0, modifier: 0
10:39:55 T:139655830136896 M:3575820288   DEBUG: OnKey: 61610 pressed, action is
which is fine. But for all the remaining keys, i just get the SDL scancode :
Code:
10:39:55 T:139655830136896 M:3575820288   DEBUG: SDLKeyboard: scancode: 123, sym: 0, unicode: 0, modifier: 0
10:39:55 T:139655830136896 M:3575820288   DEBUG: SDLKeyboard: scancode: 121, sym: 0, unicode: 0, modifier: 0
and no OnKey information.

Hence, i cannot used these keys under XBMC thru the keymap.xml
My questions :
1 - Why the SDL scancode is captured, but not translated to a OnKey value ?
2 - What is the solution to get those keys recognized ?

Thanks !

System : OpenSUSE 11.3, kernel 2.6.34.10-0.2-desktop
XBMC running in -fs mode (ie no graphical desktop behind)
XBMC v10.1 (-4.24), installed directly from the packman repository http://packman.links2linux.de
xbmc doesn't use the scancode since they are hardware dependent and can not be counted on to be the same key between platforms and devices.

If there isn't a sym code, xbmc won't do anything. That said xbmc will translate a very limited number of scancodes to sym's mostly for multimedia keys.

The primary scancode to sym mapping is done by the SDL layer in X I believe. There is xmodmap I believe that can be used to remap keys in X to something that xbmc will see. Try that.

I believe that you can also create a .Xmodmap file in your home directly to do the mapping. Google those to find out more.
After googling and reading the various documentation around Xorg and InputClass stuff, i finally close the issue by adding the following section in my xorg.conf :
Code:
Option "AutoAddDevices" "false"
in the Section "ServerFlags"

And now my media keys are working perfectly !!!
Thanks for the info. Did you have to add that section? I have a ServerLayout section, but not a ServerFlags.
yes sorry, it works also in ServerLayout