OK, since no one seems to have a clue about this, I'll reply to myself with what I have discovered so far. BTW, the remote in question is RM518, it connects via the USB dongle (same way as the keymote), and I guess it also acts as a keyboard.
Main keyboard definition is at this location:
/usr/share/xbmc/system/keymaps/keyboard.xml
The best thing to get an idea how it works is to open the file and have a look. These key definitions can be overridden by user definitions, at this location:
$home/.xbmc/userdata/keymaps/keyboard.xml
To get the key codes, enable debug logging (Settings->System->Debugging), and monitor the keypresses:
tail -f /home/neurosuser/.xbmc/temp/xbmc.log
These are some of the debug output lines I get for various keys:
Down:
DEBUG: SDLKeyboard: scancode: 116, sym: 274, unicode: 0, modifier: 0
DEBUG: OnKey: 61480 pressed, action is 4
Right:
DEBUG: SDLKeyboard: scancode: 114, sym: 275, unicode: 0, modifier: 0
DEBUG: OnKey: 61479 pressed, action is 2
Numpad "1":
DEBUG: SDLKeyboard: scancode: 87, sym: 257, unicode: 0, modifier: 0
DEBUG: OnKey: 61537 pressed, action is 59
Power:
DEBUG: SDLKeyboard: scancode: 150, sym: 0, unicode: 0, modifier: 1000
Play:
DEBUG: SDLKeyboard: scancode: 172, sym: 0, unicode: 0, modifier: 0
DEBUG: OnKey: 61619 pressed, action is 12
Back:
DEBUG: SDLKeyboard: scancode: 22, sym: 8, unicode: 8, modifier: 0
DEBUG: OnKey: 61448 pressed, action is 9
*:
DEBUG: SDLKeyboard: scancode: 63, sym: 268, unicode: 42, modifier: 0
DEBUG: OnKey: 61544 pressed, action is 66
#:
DEBUG: SDLKeyboard: scancode: 50, sym: 304, unicode: 0, modifier: 0
DEBUG: OnKey: 61600 pressed, action is 0
Window close (upper left on the remote):
DEBUG: SDLKeyboard: scancode: 70, sym: 285, unicode: 0, modifier: 100
DEBUG: OnKey: 61555 pressed, action is 0
Enter:
DEBUG: SDLKeyboard: scancode: 36, sym: 13, unicode: 13, modifier: 0
DEBUG: OnKey: 61453 pressed, action is 7
Clear(seems to be identical to Back):
DEBUG: SDLKeyboard: scancode: 22, sym: 8, unicode: 8, modifier: 0
DEBUG: OnKey: 61448 pressed, action is 9
Numlock(identical to *):
DEBUG: OnKey: 61544 pressed, action is 66
DEBUG: SDLKeyboard: scancode: 63, sym: 268, unicode: 42, modifier: 0
CH-:
DEBUG: SDLKeyboard: scancode: 117, sym: 281, unicode: 0, modifier: 0
DEBUG: OnKey: 61474 pressed, action is 6
CH+:
DEBUG: SDLKeyboard: scancode: 112, sym: 280, unicode: 0, modifier: 0
DEBUG: OnKey: 61473 pressed, action is 5
Record:
DEBUG: SDLKeyboard: scancode: 27, sym: 114, unicode: 18, modifier: 40
DEBUG: OnKey: 61602 pressed, action is 0
I am not sure what all this information means, but I figured out I can use the "OnKey" codes as the "key id" codes in the keyboard.xml. The next step is to link those to the some of the built-in functions, you can find a list here:
http://wiki.xbmc.org/index.php?title=List_of_Built_In_FunctionsAnd this is what I've done so far in my user definitions:
<keymap>
<global>
<keyboard>
<key id='61555'>Suspend </key> <!-- Window close puts the Neuroslink into standby -->
</keyboard>
</global>
<FullscreenVideo>
<keyboard>
<key id='61600'>ShowSubtitles</key> <!-- # should toggle the subtitles, but for some reason it does not work -->
<key id='61474'>SmallStepBack</key> <!-- While watching video, press CH- to step back by a couple of seconds -->
<key id='61602'>CodecInfo</key> <!-- # Gives real time decoding info -->
</keyboard>
</FullscreenVideo>
</keymap>
The remaining issues I have now are:
1. Why are some keys not working (i.e. no debug events get recoded at all)? For instance, none of the color keys work. Remote driver issues? Any way to fix this?
2. Power key has a SDLKeyboard code, but no OnKey codes is mapped to it - so I don't know how to link an action to it.
Any advices besides recommending to have a look in the source code? Which I would actually really like to do, but unfortunately have no time to go that deep