Kodi Community Forum

Full Version: keymap.xml adding new keyboard action ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm trying to map the 3 following actions to get them directly available on my keyboard: ShowSubtitles (e), NextSubtitle (d) and AudioNextLanguage (v).

I created a file $HOME/.xbmc/userdata/keymap.xml and put in it:
<keymap>
<video>
<keyboard>
<e>ShowSubtitles</e>
<d>NextSubtitle</d>
<v>AudioNextLanguage</v>
</keyboard>
</video>
</keymap>

But that didn't work...
That seems confirmed by the messages in the log:
INFO: load keymapping
INFO: Loading special://xbmc/system/Keymap.xml
DEBUG: CButtonTranslator::Load - no userdata keymap found, skipping

So, I corrected that one with renaming keymap.xml to Keymap.xml

But without any more success. In the log, when I try to hit my keys (e, d, and v), I see something like:
DEBUG: SDLKeyboard: scancode: 26, sym: 101, unicode: 101, modifier: 0
DEBUG: OnKey: 61509 pressed, action is 0
DEBUG: SDLKeyboard: scancode: 40, sym: 100, unicode: 100, modifier: 0
DEBUG: OnKey: 61508 pressed, action is 0
DEBUG: SDLKeyboard: scancode: 55, sym: 118, unicode: 118, modifier: 0
DEBUG: OnKey: 61526 pressed, action is 0

My keys does not seems to be correctly mapped (action is 0)...

Can someone points me where I'm missing something?

I tried replacing the letters by the "OnKey" or "scancode" values I see in the log with no success either...

For information:
letter / onkey value / scancode value
e / 61509 / 26
d / 61508 / 40
v / 61526 / 55

Thank you for any help you could give Smile

Typhoe

Note: I relied on the following wiki pages:
Keymap.xml : http://wiki.xbmc.org/?title=Keymap.xml
Window_IDs : http://wiki.xbmc.org/?title=Window_IDs
Do have a look at this.
List of Built In Functions
Waffa Wrote:Do have a look at this.
List of Built In Functions

Thank you for this quick answer... but I don't understand how the built in functions are relevant to my wish (add 3 keyboard mapping)?

Can you explain a little more?

Thank you
Make a copy off your keymap, located: xbmc\system\keymap.xml.
Past it in your userdata folder. So changesmade in your keymap will not be lost if you do a build update.

You want to go to video osd:
Ad this in keymap.xml <global> <keyboard>
<a>ActivateWindow(OSDVideoSettings)</a>

This is only an example
Thank you so much!

That's now working!

What I did:
copy the default Keymap.xml from the system directory to my userdata one:
(my svn version is in $HOME/XBMC, so I didSmile
cp $HOME/XBMC/system/Keymap.xml $HOME/.xbmc/userdata/Keymap.xml

Then I edited it, and found a section window_ID=<FullscreenVideo> with already 2 keymaps I wanted:
[...]
<FullscreenVideo>
[...]
<keyboard>
[...]
<t>ShowSubtitles</t>
<l>NextSubtitle</l>
[...]
I just added a new entry in this section to get the last one I wanted:
<a>AudioNextLanguage</a>

And reload xbmc ! "et voila!"

Thank you again!

Typhoe
Quick learner.Big Grin