August 18, 2012, 09:49:15 am
News:
Pages: [1]
Print
Author Topic: Remote button presses -> actions  (Read 1405 times)
sh_kilnao
Newbie
*
Posts: 5


View Profile
« on: January 14, 2011, 04:05:44 am »

I have one question regarding the remote that comes with Phantom I would appreciate some help with. Basically, my question is how to assign various actions to the button presses, or modify the existing ones? I just need to find the configuration files I need to modify, and I think I would be able to work it out myself. Have looked around the filesystem for a bit, but no luck.

I particular, I would like to achieve the following with the remote and XBMC:
-Put Link into standby
-Shortcut to a particular folder (either Music, Movies or Shows)
-Possibility to manually enter the chapter number to jump to in a video
-Toggle subtitles

Many thanks!
Logged
sh_kilnao
Newbie
*
Posts: 5


View Profile
« Reply #1 on: February 04, 2011, 06:44:09 pm »

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_Functions

And 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
Logged
ChadV
Administrator
Hero Member
*****
Posts: 1596


View Profile WWW
« Reply #2 on: February 06, 2011, 07:23:04 pm »

My understanding is that the colored keys are programmable macro keys, but I could be mistaken.  Your remote manual should have information on those.

I'm afraid whatever it is you said in #2 is beyond what I know about the I/O...  I would think that the power button would be handled at a lower level than at the OS mapping, though, in order for power-on to work (for devices that support Wake-on-USB, like the LINK v1.3)
Logged
sh_kilnao
Newbie
*
Posts: 5


View Profile
« Reply #3 on: February 08, 2011, 05:42:45 pm »

My understanding is that the colored keys are programmable macro keys, but I could be mistaken.  Your remote manual should have information on those.

The only manual I can find is this one: http://www.focus.com.tw/products-con.php?p_id=74&id=36
My theory is that the colored keys work only in Windows, probably because the generic drivers in Linux do not support this. I believe this is the case because no SDLKeyboard events are logged when one of these are pressed. Now, I may be mistaken as I have no clue what is the connection between the keyboard/remote driver to the SDL - maybe it is just an issue of configuration?

I'm afraid whatever it is you said in #2 is beyond what I know about the I/O...  I would think that the power button would be handled at a lower level than at the OS mapping, though, in order for power-on to work (for devices that support Wake-on-USB, like the LINK v1.3)

I think it only happens at the lower level for the power-on case, normally it results into just another scancode (SDLKeyboard: scancode: 150) and for some reason it is not assigned an OnKey code. My guess is that this is due how XBMC is set. In any case, I won't know for sure before I delve deeper, either in SDL or in XBMC. When and if I do that, I'll post what I found here...
Logged
Pages: [1]
Print
Jump to: