Can 'Sharp' and 'Star' be remapped in Keyboard.xml?
#1
Question 
A friend bought a Moneual 312 case. It is a beautiful case with a built-in IR but the IR is a piece of crap. It will only receive the codes from it's own remote (RC6) or a basic MCE remote (no extended functions).

Well, I tried Evenghost (it kept crashing) and IR Server Suite with no luck. My main problem is the 'more' (info) button. It is the only button (aside from Recorded TV, Live TV, etc...) on this remote that doesn't map to a keystroke. It does work (even on my Antec Fusion) as the intended function in W7MC but it doesn't generate a keystroke.

So, I was going to attempt to map 2 unused buttons (# and *) that do generate a keystroke as the 'info' function and just map his Harmony's 'Info' button to one of these buttons. Well, even despite jhsrennie's great work I still can't map these buttons.

These are the combinations I tried on a recent SVN:

<three mod="shift">Info</three>
<sharp>Info</sharp>
<#>Info</#>

Is there some way to map the 'Sharp' button with the keyboard.xml? From the quick glance I gave to jhsrennie's custom Camelot source, it looks like only letters can accept mods (shift, ctrl, etc...).
Reply
#2
Try:

<key id="61539">Notification(Key, hash, 3)</key>

ShowKey helpfully suggests the wrong XML when I press the hash key. I suspect this is something to do with UK vs US keyboard mappings.

The way I got the above was to turn on debug logging then press the hash key. In XBMC.log I found:

CApplication::OnKey: 61539 pressed, action is 61

That gives me the key code 61539 to put in the XML above.

JR
Reply
#3
Thank you for pointing me in the right direction! After enabling Debug logging in the last nightly released, I noticed the keystrokes those 2 keys on the remote were sending. Actually, they send 2 keystrokes each. The first keystroke is 'Left Shift' (61600). The subsequent keystroke generated after the 61600 didn't work reliably. Any idea what 'keyboard action 61731 and 61738' are?

DEBUG: CApplication::OnKey: 61600 pressed, action is
DEBUG: SDLKeyboard: scancode: 4, sym: 51, unicode: 35, modifier: 1
DEBUG: CApplication::OnKey: 192611 pressed, trying keyboard action 61731
DEBUG: SDLKeyboard: scancode: 42, sym: 304, unicode: 0, modifier: 0
DEBUG: CApplication::OnKey: 61600 pressed, action is
DEBUG: SDLKeyboard: scancode: 9, sym: 56, unicode: 42, modifier: 1
DEBUG: CApplication::OnKey: 192616 pressed, trying keyboard action 61738
Reply
#4
Ah, the scan code 4 is the "3" key and 9 is the "8" key, so your remote is sending shift-3 and shift-8. On a US keyboard shift-3 is #. On a UK keyboard it's the pound sign.

Looking at the second OnKey log, 192611 is hex 2F063, which is shift and numpad 3. The fourth OnKey code, 192616, is hex 2F068 or shift and numpad 8. Try using:

<numpadthree>Notification(Key, numpadthree, 3)</numpadthree>
<numpadeight>Notification(Key, numpadeight, 3)</numpadeight>

For reasons that are obscure trying to use the shift modifier by itself has no effect, so you shouldn't need a mod="shift". If the above doesn't work you could try:

<numpadthree mod="shift">Notification(Key, shift-numpadthree, 3)</numpadthree>
<numpadeight mod="shift">Notification(Key, shift-numpadeight, 3)</numpadeight>

JR
Reply
#5
Paco, did you manage to map # correctly? I also have an el cheapo remote and would like to map * and #, so I'm sitting with exactly the same problem. The above-mentioned mappings didn't work.
Reply
#6
Enable debug logging, press * and # a couple of times then disable logging again. look in xbmc.log for the lines shown in post 3 above, and post those lines (just those lines not the whole log!!) here.

What remote are you using? If it's one of the remotes described in http://wiki.xbmc.org/?title=Remote_Control_Reviews I might have one lying around.

JR
Reply
#7
My debug output is very similar to paco's

For the hash button:
23:24:56 T:3077461872 M:2603683840 DEBUG: SDLKeyboard: scancode: 50, sym: 304, unicode: 0, modifier: 0
23:24:56 T:3077461872 M:2603683840 DEBUG: OnKey: 61600 pressed, action is
23:24:56 T:3077461872 M:2603683840 DEBUG: SDLKeyboard: scancode: 12, sym: 51, unicode: 35, modifier: 1
23:24:56 T:3077461872 M:2603683840 DEBUG: OnKey: 192611 pressed, trying keyboard action 61731

For the star button:
23:26:06 T:3077461872 M:2603978752 DEBUG: SDLKeyboard: scancode: 50, sym: 304, unicode: 0, modifier: 0
23:26:06 T:3077461872 M:2603978752 DEBUG: OnKey: 61600 pressed, action is
23:26:06 T:3077461872 M:2603978752 DEBUG: SDLKeyboard: scancode: 17, sym: 56, unicode: 42, modifier: 1
23:26:06 T:3077461872 M:2603978752 DEBUG: OnKey: 192616 pressed, trying keyboard action 61738

The remote is some really cheap unbranded remote and looks like this:
http://imgur.com/Z0Z0D
Reply
#8
lsusb gives:
...
Bus 004 Device 002: ID 1130:6604 Tenx Technology, Inc.
...

If you google that it seems to be some non-standard non-lirc remote, but rather "pretty much a wireless keyboard/mouse combo packaged in a remote controlled shaped case." (as one guy put it). http://ubuntuforums.org/showthread.php?p=8213252
Reply
#9
The # button is sending a shift-3 keypress and the * button is sending shift-8. That's why you see a pair of keypresses. The first is XBMC seeing the shift key and the second is the 3 or 8 keypress.

The bad news is that v10.1 cannot assign actions to shift-anykey combinations because the shift key is treated specially (it's used for navigation ion lists). So you can't assign actions to the keys. This has changed in the current development code, so you could assign actions to the buttons if you use a nightly build from mirrors.xbmc.org. Note however that while these builds are generally pretty good they are development code and may contain bugs. They will also upgrade your database to a version that v10.1 cannot use, so backup your database first.

JR
Reply
#10
Thanks, I'm on XBMCLive for now, so I'll just wait.
Reply
#11
Well, I'll toss my hat in on this problem. Same thing - assigning asterisk adn Pound Keys on Harmony remote programmed as a MCE remote.


19:29:23 T:3704 M:2871939072 DEBUG: SDLKeyboard: scancode: 55, sym: 268, unicode: 42, modifier: 0
19:29:23 T:3704 M:2871939072 DEBUG: CApplication::OnKey: 61544 pressed, action is Number8
19:29:26 T:3704 M:2871730176 DEBUG: SDLKeyboard: scancode: 56, sym: 308, unicode: 0, modifier: 0
19:29:26 T:3704 M:2871730176 DEBUG: SDLKeyboard: scancode: 81, sym: 259, unicode: 51, modifier: 100
19:29:26 T:3704 M:2871730176 DEBUG: CApplication::OnKey: 323683 pressed, action is
19:29:26 T:3704 M:2871730176 DEBUG: SDLKeyboard: scancode: 76, sym: 261, unicode: 53, modifier: 100
19:29:26 T:3704 M:2871730176 DEBUG: CApplication::OnKey: 323685 pressed, action is
19:29:29 T:3704 M:2873556992 DEBUG: SDLKeyboard: scancode: 28, sym: 13, unicode: 13, modifier: 0


Currently, pushing the # key does nothing, but Showkey.exe shows two commands. The first flashes by too quickly. pushign the button bound to Asterisk only brings up a small XBMC OSD taht displays the elapsed/total time of whatever I'm watching, yet Icannot find astisk anywehre in any of my keymap files.
Reply
#12
Code:
DEBUG: CApplication::OnKey: 61544 pressed, action is Number8

This is 8

Code:
DEBUG: CApplication::OnKey: 323683 pressed, action is

This is alt-3

Code:
DEBUG: CApplication::OnKey: 323685 pressed, action is

This is alt-5

JR
Reply
#13
Very sweet. Thank you kindly.

How do you know this, btw? Not that I don't think you're correct, I'd just like to know so I won't have to harass the forums again, and for anyone else that comes across this.

thanks again
Reply
#14
It would be great if the logging also contained the 'decoded' key code and printed something like "alt-5". It'll save a lot of frustration for some users.
Reply
#15
igitur Wrote:It would be great if the logging also contained the 'decoded' key code and printed something like "alt-5". It'll save a lot of frustration for some users.

The nightlies do this.

To interpret the key code convert it to hex e.g. 323683 is 0x04F063. Now:

- the top byte is a bitfield showing the modifiers where control is 0x01, shift is 0x02 and alt is 0x04. These can be combined e.g. ctrl-shift is 0x03 = 0x01 + 0x02.

- the middle byte is always 0xF0 and can be ignored

- the bottom byte is the key code. This is just the ascii code for letters e.g. A is 0x41. For numbers 0 -9 the codes are 0x60 to 0x69. For other keys you'll need to look them up in the source code.

But as I say, in the nightly builds and the next release of XBMC the debug log shows the key names not just an apparently random number.

JR
Reply

Logout Mark Read Team Forum Stats Members Help
Can 'Sharp' and 'Star' be remapped in Keyboard.xml?0