Forum

Full Version: How to map unknown keys?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I've got a new remote control - Mele F10 Deluxe - and it has some buttons that XBMC does not known. If I look into the log file, I see for example:

14:25:38 T:3037372416 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(139)

The key code 139 is not defined in XBMC_keysym.h (https://github.com/xbmc/xbmc/blob/master/xbmc/input/XBMC_keysym.h) and has no mapping in LinuxInputDevices.cpp (https://github.com/xbmc/xbmc/blob/master/xbmc/input/linux/LinuxInputDevices.cpp).

According to the XBMC wiki (http://kodi.wiki/view/List_of_XBMC_keynames), it should be possible to map unknown keys with the <key id="..."> XML element, but if I look to the source code (LinuxInputDevices.cpp), it is clear that it is not.

Is there any way how to map this kind of buttons?

Thank you!
Hi,

I've got the same problem with mapping non standard keys. Did you find solution?
(12th Nov, 2014 03:24 AM)irkam Wrote: [ -> ]Hi,

I've got the same problem with mapping non standard keys. Did you find solution?

Unfortunately not...
look at

/usr/local/share/xbmc/system/keymaps/

in your installation.

at the source code level the system level resolving is handled in xbmc/input/linux/LinuxInputDevices.cpp. if you check table keyMap, on the left is code returned from OS which is resolved into XBMC internal key code on the right. of course the key codes on left are OS specific but in this case linux provides the mapping in (/usr/)include/linux/input.h.

looking into it 139 is KEY_MENU and indeed it is not defined in xbmc's xbmc/input/linux/LinuxInputDevices.cpp. if you would decide to try patching the code and recompile, then you would add into keyMap table this line:

Code:
{ KEY_MENU             , XBMCK_c           },

or even directly with number

Code:
{ 139             , XBMCK_c           },

(in XBMC key"C" is key for display context menu.)
Thank you for your reply. I'm sure it is possible to get it working by patching the code and it is quite easy, but I was trying to find a solution without the need to patch the code. Now I see it is most likely not possible.
@hrbi

yes, exactly that means it.
personally I don't see a reason not to try it. if there wasn't any special PROBLEM with code 139 (as indication why it is not recognised by default at all), we can put such small patch into next test build and you will try.

but before you ask for that, try just simple googling for "139 keycode xbmc" if you get any relevant info (why it could be excluded by default). if you don't find anything in 10-15minutes, lets try include it.

(looks like 139 should be key F18) Wink

that means we should not run into conflicts.
Reference URL's