Kodi Community Forum

Full Version: Full keyboard.xml for cheap "MCE" remotes.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I bought a cheap MCE remote from eBay for my GF's HTPC. It took forever to figure out what was up with it, and why it wasn't working like I thought it should.

For those that don't know, cheap MCE remotes actually present themselves to the OS as HID input devices. This one actually shows up as a Keyboard and Mouse. So LIRC doesn't register it.

There are ways to use LIRC, but it requires a few mods to blacklist. When I did get it to work, most keys sent double key presses (rather than Alt-F4, it'd send an LIRC KEY_ALT, KEY_F4).

So I figured I'd just bite the bullet and generate a custom keymap.xml, however
Code:
SDLKeyboard: scancode: 14, sym: 53, unicode: 53, modifier: 0
Isn't very descriptive with what keys are what and I didn't want to have to use <key ID=""> for every:
Code:
OnKey: 61541 pressed, action is
event.

So I let PHP generate a permutation of all available keys and mod keys. (Code: http://sprunge.us/RDOT, A-Z and all the keys from ButtonTranslator)

One includes all the modkeys (left shift, right shift, left alt, right alt, etc).
http://sprunge.us/CcEe

One doesn't. (It was getting annoying triggering events for a left alt).
http://sprunge.us/OaEV

Code:
# With Mod Keys
cd ~/.xbmc/userdata/keymaps/
curl -o keyboard.xml http://sprunge.us/CcEe
xbmc-send -a "reloadkeymaps"

Code:
# Without Mod Keys
cd ~/.xbmc/userdata/keymaps/
curl -o keyboard.xml http://sprunge.us/OaEV
xbmc-send -a "reloadkeymaps"
-
Then just been going through the remote, using search and replace and changing the notify events to what commands I need from:
http://wiki.xbmc.org/?title=List_of_Built_In_Functions
http://wiki.xbmc.org/index.php?title=Window_IDs
http://wiki.xbmc.org/index.php?title=Keymap.xml#Actions