I want to map the "Options" button on my remote to "Context Menu" on Kodi.
Button presses from my remote are converted to "key presses" via CEC driver.
So to achieve my goal I have tried this:
1) Editting Kodi's keyboard.xml
In order to know the exact keycode, I enabled Kodi's depuration log, and this is what I get:
Code: Select all
12:38:41 T:3035914240 DEBUG: Keyboard: scancode: 0x93, sym: 0x1008ff65, unicode: 0x0000, modifier: 0x0
12:38:41 T:3035914240 DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
12:38:41 T:3035914240 DEBUG: Previous line repeats 1 times.
Anyway, I can edit keyboard.xml in order to configure keycode "0xf200" to the ContextMenu but ...... surprise ... the stop button is also getting 0xf200 code on Kodi, so I have to choose between "Stop" and "Context Menu". The first wins

2) xmodmap
Using "xev" (out from Kodi, on LXTerminal), I get this:
Code: Select all
KeyPress event, serial 37, synthetic NO, window 0x2400001,
root 0xa5, subw 0x0, time 7944183, (163,-16), root:(219,84),
state 0x0, keycode 147 (keysym 0x1008ff65, XF86MenuKB), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
In KODI, if we want to popup the context menu, we only need to press "C" on the selected item. So, using "xmodmap", I tried to map keycode 147 to letter "C", like this:
Code: Select all
xmodmap -e "keycode 147 = C"
Code: Select all
keycode 147 = c C c C
Code: Select all
keycode 147 = XF86MenuKB NoSymbol XF86MenuKB
3) Changing keyboard layout
using setxkbmap, I tried to modify "us" keyboard layout, trying to assign keycode 147 to "C" letter, with no success.
And finally dropped out, I was modifying root files and actually I was not concerned of what I was exactly doing ....
I'm a bit desperate right now. Don't know what more to do. So I decided to ask for help here. Which is the correct way to achieve this?
Many thanks to all.
Gram.