Kodi Community Forum

Full Version: Problem mapping power buttons on remote
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As seen on the wiki, I'm using the XBMC debug option to push the buttons I want to map, get the ID and configure them in a xml file inside the keymaps folder ($HOME/.xbmc/userdata/keymaps/keys.xml). My remote is configured as inputdev on lirc, so it acts like a keyboard (despite being a remote), but when pressing the power button (the red one), the debug of XBMC display's the key ID of the button as 0, while other buttons seem to get a correct ID:
Code:
19:56:45 T:140722950248256   DEBUG: SDLKeyboard: scancode: 96, sym: 009f, unicode: 0000, modifier: 0
19:56:45 T:140722950248256   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
19:56:45 T:140722950248256   DEBUG: Previous line repeats 1 times.
19:56:45 T:140722950248256   DEBUG: OnKey: 0 (f200) pressed, action is
19:56:50 T:140722950248256   DEBUG: SDLKeyboard: scancode: 97, sym: 0000, unicode: 0000, modifier: 0
19:56:50 T:140722950248256   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
19:56:50 T:140722950248256   DEBUG: Previous line repeats 1 times.
19:56:50 T:140722950248256   DEBUG: OnKey: 0 (f200) pressed, action is
19:57:02 T:140722950248256   DEBUG: SDLKeyboard: scancode: 24, sym: 000d, unicode: 000d, modifier: 0
19:57:02 T:140722950248256   DEBUG: OnKey: return (f00d) pressed, action is Select

I've tried configuring the XML with both <key id="0"> and <key id="0xf200">, but XBMC doesn't seem to like it:
Code:
<keymap>
    <global>
        <keyboard>
            <key id="0">XBMC.Suspend</key>
            <key id="0xf200">XBMC.Suspend</key>
        </keyboard>
    </global>
</keymap>

Any idea where could be the problem? Should I try to reconfigure the remote as an specific device instead of devinput?

My configuration is the following:
Gentoo x86_64
Kernel 3.6.11
XBMC 11 (installed via emerge)
Zotac remote from ZBOX (Identified as PHILIPS MCE USB IR Receiver - Spinel plus from lsusb)
Try this instead:
Code:
<zero>XBMC.Suspend</zero>

Although I think it's risky to use 0 to suspend your system. Or do you not use a real keyboard on your system to enter text and numbers while in XBMC (i.e., you only use the virtual keyboard)?
Right now I have a normal keyboard and the remote, I'm using the keyboard to configure the box, but the idea once its all setup would be to mainly use the remote and have a wireless keyboard if I want to search or do something that I need to type.

Mapping <zero> as the action, wouldn't also map the number key 0 as suspend? This is the remote I have, so you can check the keys:
Image

The ones I want to map are the two red ones. On the debug info they appear as:
Code:
scancode: 96, sym: 009f
scancode: 97, sym: 0000
(2013-03-21, 14:37)wsnipex Wrote: [ -> ]see step 13 from http://youresuchageek.blogspot.fr/2012/0...linux.html

It seems its almost a need to use FernetMenta's sources. I've adapted the sources to my distro and seems to be working without problems. Now all the buttons are mapped Big Grin