"record" button on keyboard not recognised by xbmc - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: "record" button on keyboard not recognised by xbmc (/showthread.php?tid=50532) |
"record" button on keyboard not recognised by xbmc - hjbotha - 2009-05-07 Hi guys, I have a MS Wireless Entertainment Desktop keyboard hooked up to my XBMC PC. Most of the buttons work just fine (play/pause, ff, rw, volume) but the keyboard lacks a stop button. Instead, I've been trying to map the Record button to be the stop button. The problem: I can't get XBMC to see it. Here's what I've done in Keymap.xml: <keymap> <global> <keyboard> <record>Stop</record> </keyboard> <remote> <record>Stop</record> </remote> </global> </keymap> When I start XBMC I get this: Code: 01:48:02 T:1261738000 M:1581006848 INFO: Loading special://xbmc/system/Keymap.xml So it seems like XBMC isn't programmed to recognise this button. If I press play/pause followed by record, I have: Code: 01:49:58 T:1261738000 M:1558769664 DEBUG: SDLKeyboard: scancode: 172, sym: 0, unicode: 0, modifier: 0 Is it significant that there is no OnKey line for record? Thanks for any pointers. H Edit: I should add I'm running Xubuntu 9.04 + latest XBMC from the team-xbmc ppa. - spiff - 2009-05-08 try <key id="65405">Stop</key> i *think* that should work - hjbotha - 2009-05-08 No good. Can I ask how you arrived at that code? Perhaps I can do some research in that direction. - spiff - 2009-05-08 ehrr, math error ;P 0xFF00 + keycode - hjbotha - 2009-05-08 Sorry, this isn't making sense to me *looks sheepish* keycode = scancode? FF00 = 65280, + 172 (the SC for play/pause) = 65452 = 0xFFAC but according to the log Code: 02:34:13 T:1388501008 M:1511378944 DEBUG: SDLKeyboard: scancode: 172, sym: 0, unicode: 0, modifier: 0 What am I missing? - spiff - 2009-05-08 Code: #ifdef _LINUX i'm too tired to think straight atm, that is from ButtonTranslator.cpp (dunno if you speak c) - spiff - 2009-05-08 okay, i couldn't quite give up ;P from SDLKeyboard.cpp Code: // based on the evdev mapped scancodes in /user/share/X11/xkb/keycodes Code: playpause = 172 -> 164 = b3 -> 0xffb3 (0xFF00 + 0x00B3) hence record should be Code: record = 179 -> 167 = b6 -> 0xFFB6 - hjbotha - 2009-05-08 alas, still no luck but you've given me some stuff to think about so I'll do some more research. The thing that gets me a little bit is, yeah this makes total sense for these buttons, but look at volume_up: Code: 03:15:50 T:3005671440 M:1577381888 DEBUG: SDLKeyboard: scancode: 123, sym: 0, unicode: 0, modifier: 0 scancode 123 -> keycode AF (175). That's not in evdev. * hjbotha wanders off to have a look at SDLKeyboard.cpp Edit: Oh btw, that snippet of ButtonTranslator you posted was interesting for this bit: Code: if (wAction == 0 && (wKey & KEY_VKEY) == KEY_VKEY && (wKey & (DWORD)0x0F00)) { I never get that Hardy message for this button, whereas I do get it for others, so that if statement is returning false. Again, I don't know how relevant this is, but if that part is really important then no way any of this will make any difference. - hjbotha - 2009-05-08 Quick update... In SDLKeyboard.cpp there's this line Code: //else if (m_keyEvent.key.keysym.scancode == 167) m_VKey = 0xb3; // Record Note that it's commented in the source. I've changed it to Code: else if (m_keyEvent.key.keysym.scancode == 175) m_VKey = 0xb6; // Record but unfortunately I'm having some instability on this system at the moment so I can't recompile to test. I'll post here once I manage it. - hjbotha - 2009-05-27 Success \o/ xbmc/ButtonTranslator.cpp: Code: else if (strKey.Equals("record")) wButtonCode = 0xF0B7; guilib/common/SDLKeyboard.cpp Code: else if (m_keyEvent.key.keysym.scancode == 175) m_VKey = 0xb7; // Record and in ~/.xbmc/userdata/Keymap.xml: Code: <keymap> I probably could have just put the line into SDLKeyboard.cpp and that would have let me assign an action to the key ID, but by also putting it in ButtonTranslator I could assign it to "record". Thanks spiff H |