(LINUX) Keymap the star key on numpad

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
eoan Offline
Junior Member
Posts: 4
Joined: Jun 2011
Reputation: 0
Post: #1
Hi all - I'm trying to figure out whether I can use a stand-alone numpad I have lying around as a remote for XBMC. I read through various posts in the forum and the wiki pages, and took a look at the system keyboard.xml, and to test things out I created the following keymap.xml

Code:
<keymap>
  <global>
    <keyboard>
      <!-- ... constant key mappings here -->
      <forwardslash>Notification(Key, forwardslash, 1)</forwardslash>
      <minus>Notification(Key, minus, 1)</minus>
      <plus>Notification(Key, plus, 1)</plus>
      <Enter>Notification(Key, Enter, 1)</Enter>
      <star>Notification(Key, Star, 1)</star>
      <!-- ... number key mappings here -->
      <numpadzero>Notification(Key, 0, 1)</numpadzero>
      <numpadone>Notification(Key, 1, 1)</numpadone>
      <numpadtwo>Notification(Key, 2, 1)</numpadtwo>
      <numpadthree>Notification(Key, 3, 1)</numpadthree>
      <numpadfour>Notification(Key, 4, 1)</numpadfour>
      <numpadfive>Notification(Key, 5, 1)</numpadfive>
      <numpadsix>Notification(Key, 6, 1)</numpadsix>
      <numpadseven>Notification(Key, 7, 1)</numpadseven>
      <numpadeight>Notification(Key, 8, 1)</numpadeight>
      <numpadnine>Notification(Key, 9, 1)</numpadnine>
      <period>Notification(Key, period, 1)</period>
      <!-- ... function key mappings here -->
      <KP_Up>Notification(Key, Up, 1)</KP_Up>
      <KP_Down>Notification(Key, Down, 1)</KP_Down>
      <KP_Left>Notification(Key, Left, 1)</KP_Left>
      <KP_Right>Notification(Key, Right, 1)</KP_Right>
      <KP_Home>Notification(Key, Home, 1)</KP_Home>
      <KP_End>Notification(Key, End, 1)</KP_End>
      <KP_Prior>Notification(Key, Prior, 1)</KP_Prior>
      <KP_Next>Notification(Key, Next, 1)</KP_Next>
      <KP_Begin>Notification(Key, Begin, 1)</KP_Begin>
      <KP_Insert>Notification(Key, Insert, 1)</KP_Insert>
      <KP_Delete>Notification(Key, Delete, 1)</KP_Delete>
    </keyboard>
  </global>
</keymap>

I've found two things that don't work as expected:

1) when I press * on the numpad XBMC displays an 8 (ie responds with Notification(Key, 8, 1) ) I thought perhaps this was because instead of star it was seeing shift+8, remembering that XBMC is case insensitive, but when I pressed shift+8 on the keyboard there was no response. Pressing 8 on the keyboard provoked a Notification(Key, 8, 1) btw.

Any ideas what I'm doing wrong?
I got <star> from looking at some remote keymaps, so maybe I'm using the wrong tag?
But then why does it respond as if I've pressed an 8? Confused and only from the numpad, not with shift+8 on the keyboard?
Is there a way I can pass the keycode or keysym codes instead of using <star>?

2) XBMC doesn't seem to be sensitive to the NumLock state - i.e. when I press 8 I get the response Notification(Key, 8, 1), but when I switch NumLock off and press 8 (which should now be 'Up' - and is seen by xev as 'KP_Up') I still get Notification(Key, 8, 1). I tried replacing <KP_Up> with just <Up> in case that made a difference, and replacing <numpadeight> with <eight>, and replacing both together, but it seems that, regardless of the NumLock state, XBMC only recognises the numbers... [Just to be clear, this happens with all the dual-function keys, not just 8 Big Grin ]

Is there anything I can do about this (maybe use the keycode or keysym codes again?) or will I have to make do without?

Thanks so much for your help!
(This post was last modified: 2011-07-22 21:24 by eoan.)
find quote
X3lectric Offline
Closed Account
Posts: 1,756
Joined: Feb 2006
Location: in a Dropbox
Post: #2
I believe GIT xbmc already maps full keyboard including numpad.

https://github.com/xbmc/xbmc/tree/master/system/keymaps
find quote
eoan Offline
Junior Member
Posts: 4
Joined: Jun 2011
Reputation: 0
Post: #3
Thanks for the reply X3lectric - I took a look through GIT's keyboard.xml before posting, and although it has specific numpad refs for digits (<numpadeight> for example) it doesn't have any for the secondary functions (ie it uses <home> but not <numpadhome> - using <home> didn't work for me, as XBMC seems only to see the numbers, regardless of the NumLock state).

Also, GIT's keyboard.xml doesn't map anything to the star key (at least, not that I have been able to find!)

It's a real puzzle! Assuming <star> is the correct ref for * why should * on the numpad be seen as 8?! And why does shift+8 generate no response, rather than Notification(Key, 8, 1) or Notification(Key, Star, 1)? The latter makes me think <star> is not the correct ref for * but I can't find anything else it could be - I tried <asterisk> too, but no joy...

I think using the keycodes or keysyms might be the best next thing to try, but I don't understand how to do that Sad
find quote
X3lectric Offline
Closed Account
Posts: 1,756
Joined: Feb 2006
Location: in a Dropbox
Post: #4
another suggestion is to direct you to freenode IRC xbmc-linux great devs/users there that can help you crack this.

perhpas someone will chime in,idk but I do recommend the IRC channel.
find quote
jhsrennie Offline
Team-XBMC Developer
Posts: 7,236
Joined: Nov 2008
Reputation: 119
Location: Chester, UK
Post: #5
Dharma doesn't recognise the numeric keypad as being different from the main keyboard. Pressing * on the numpad is recognised as the 8 key because * shares the 8 key on the main keyboard. NB Dharma recognises the key not the character, so "8" really means the key labelled 8* not the character '8'.

This behaviour has changed in the nightly builds. You still can't use the * key on the main keyboard (though this may be changing soon), but you can use * on the numpad. The key name is "numpadtimes".

To see what keynames are available in the nightlies look at https://github.com/xbmc/xbmc/blob/master...ytable.cpp. All the key names are in the big table near the top of this file.

JR
find quote
eoan Offline
Junior Member
Posts: 4
Joined: Jun 2011
Reputation: 0
Post: #6
Thanks jhsrennie, that's a really helpful reply. I'll take a look through the info about the nightlies - bit scared of using them!

@X3lectric - thanks for the irc suggestion, I will keep that in mind the next time I run into a similar problem.

Edit: Btw, is there any way for me to change the title of this thread to prepend [solved] or [answered]? I tried clicking 'Thread Tools' but it didn't show up as an option...
(This post was last modified: 2011-07-27 04:28 by eoan.)
find quote
X3lectric Offline
Closed Account
Posts: 1,756
Joined: Feb 2006
Location: in a Dropbox
Post: #7
try editing main post go advanced and see if it allows you to change it there.

nightlies are just fine, the chances you get a terrible bug is mitigated by any disk imaging you do previously so you can fall back on an older version that you know works. ( I use acronis true image 2011 bootdisk or usb bootdisk.)

cheers.
(This post was last modified: 2011-07-27 04:35 by X3lectric.)
find quote