Kodi Community Forum

Full Version: keymap.xml only partially working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there.
I'm using KodiBuntu on a 64bit PC and an old Microsoft MCE RC6 IR remote (model 1039).
Kodi is running version 14.1 compiled Jan. 30, 2015.
All packages updated last Feb. 27, 2015.

Everything's been working mostly well out-of-the-box without any problems, but I decided to try and play with button mapping a bit, so I looked into it, went over the tutorials, put Lircmap.xml and Keymap.xml in place - and, well, some buttons remapped fine, some didn't.

For example, a button remapping that DID work, is the "enter" key which I've remapped to "ContextMenu", and indeed the log shows:

Code:
DEBUG: LIRC: Update - NEW at 12269:000000037ff07bf4 00 KEY_ENTER mceusb (KEY_ENTER)
DEBUG: OnKey: 22 (0x16) pressed, action is ContextMenu

However, I'm having trouble remapping the "clear" button to "ToggleWatched". It seems to be over-ridden by something and the debugging log gives:

Code:
DEBUG: LIRC: Update - NEW at 17409:000000037ff07bf5 00 KEY_CLEAR mceusb (KEY_CLEAR)
DEBUG: OnKey: 249 (0xf9) pressed, action is Delete

I've tried everything from using <key id="249">ToggleWatched</key> which gave an error about not recognizing the word "key", putting it in <keyboard> rather than <remote> (or even both at the same time), but whatever I do "KEY_CLEAR" gets "action is Delete".
Before I delved into this manual remapping I used the KeymapEditor addon and there too everything remapped fine except the "clear" key which insisted on sending "action is Delete" despite being told to send "ToggleWatched" by the remapper.

Here are my Lircmap.xml (in the userdata folder):
Code:
<lircmap>
  <remote device="mceusb">
    <clear>KEY_CLEAR</clear>
    <enter>KEY_ENTER</enter>
  </remote>
</lircmap>

My keymap.xml (in userdata/keymaps):
Code:
<keymap>
    <global>
        <remote>
            <clear>ToggleWatched</clear>
            <enter>ContextMenu</enter>
        </remote>
    </global>
</keymap>

And the FULL debug log of an example session is in this pastebin: http://pastebin.com/6FyJ5B7T

Thanks in advance for any assistance!
remote.xml?
(2015-02-27, 07:29)FishOil Wrote: [ -> ]remote.xml?

What of it?
I tried naming "keymap.xml" "remote.xml" at one point to no avail.
From the documentation though it seems as if the name doesn't matter anyway because it loads all xmls in "keymaps" regardless of name.
local mappings will always override globals. there are local mappings for certain windows that will have to be overridden as well..
(2015-02-27, 12:32)ironic_monkey Wrote: [ -> ]local mappings will always override globals. there are local mappings for certain windows that will have to be overridden as well..

Indeed, adding:

Code:
    <videolibrary>
        <remote>
            <clear>ToggleWatched</clear>
        </remote>
    </videolibrary>

to the mapping file solved it. Thanks for the tip, someone should look into adding it to the guides :-)
At current they say that anything from the "keymaps" folder overrides anything else, regardless of what window it addresses (and I figured, wrongly, that "global" was top of the hierarchy).
Thanks again!
(2015-02-27, 12:03)Ambious Wrote: [ -> ]
(2015-02-27, 07:29)FishOil Wrote: [ -> ]remote.xml?

What of it?

What of it?

Well there is a right way and lots of wrongs ways to set up a Lirc IR remote.

Its up to you. You can either understand whats going on or just plow through hacking something together till it works.

Once you understand, there is no turning back and you will have complete understanding and total flexibility with a remote.
(2015-03-01, 08:09)FishOil Wrote: [ -> ]
(2015-02-27, 12:03)Ambious Wrote: [ -> ]
(2015-02-27, 07:29)FishOil Wrote: [ -> ]remote.xml?

What of it?

What of it?

Well there is a right way and lots of wrongs ways to set up a Lirc IR remote.

Its up to you. You can either understand whats going on or just plow through hacking something together till it works.

Once you understand, there is no turning back and you will have complete understanding and total flexibility with a remote.

My original post did indeed indicate my keymap.xml layout (all the docs I read indicated that the filename is irrelevant, only the directory it's in).
Anyway, ironic_monkey's suggestion that it was a 'window' issue (having specific windows override global settings despite being in an overriding file class) worked out, and just adding the specific 'videolibrary' level solved it out.