Kodi Community Forum
Help with keymap - need to map keyboard letter "S" to xbox remote button "0" - 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: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Help with keymap - need to map keyboard letter "S" to xbox remote button "0" (/showthread.php?tid=54806)



Help with keymap - need to map keyboard letter "S" to xbox remote button "0" - The-Boxhead - 2009-07-16

is this possible. been looking on the wiki and in the forums. i cant
find out how to do it Wink


- jmarshall - 2009-07-17

You usually use <s>number0</s> in this case. The other numbers are similar. Not sure if this is what you want or not - it depends on where it's being used, and what "0" on the remote was actually mapped to.

Cheers,
Jonathan


- The-Boxhead - 2009-07-17

Okays, gonna do some testing when i get home. thanks jm.


- The-Boxhead - 2009-07-18

Hmmm JM your suggestion didn't work, tried a few others aswell with no luck.

Im trying to make the button "1" on my xbox remote to do the same
as keyboard letter "S" does.

If anyone could share some insight i would be a happy camper Smile


- rouss - 2009-07-21

I am interested in doing this as well. The idea is to map an ASCII letter to a button on the Xbox DVD remote in the keymap.xml. So, for example, typing letters with the remote for a file name. Something like:

<remote>
<zero>S</zero>
</remote>

I have tested the above and various other methods on the Xbox revision 21142 from T3CH including using the ascii hex values 0x53, 0xF053, 0xF153 in place of the "S" above. None of these methods worked.

The log outputs when I press the remote button on the remote:
21:45:20 M: 40955904 DEBUG: CApplication::OnKey: 200 pressed, action is 0

Any help in figuring this out or pointing me in the right direction would be greatly appreciated. I have taken a look at the wiki on keymap.xml as well as the key.h, ButtonTranslator.cpp source files but could not find an answer.


- jmarshall - 2009-07-22

@rouss: You can't type ascii letters using a remote. Sorry, not supported. A patch to address the deficiency would certainly be considered though.

@The_BoxHead: I interpreted your title the other way around. You want to do:

<one>ShutdownMenu</one> or whatever it is.

Check what is mapped to <s> in the <keyboard> section.

Cheers,
Jonathan


- spiff - 2009-07-22

and the whole point is - u do NOT map keys to keys, you map keys to actions


- rouss - 2009-07-22

@jmarshall: I am not sure exactly where I should start. My programming skills are not very strong but I am willing to take a crack at it. I'm guessing with ButtonTranslator.cpp?

@spiff: Of course, that would be pointless but creating an infrared remote with a full keyboard that would allow the user to input text isn't pointless. My goal is not to map the "S" key to the zero key on the remote and have it function like pressing the "S" on a keyboard. The point would be to input text via infrared in XBMC when need be.


- spiff - 2009-07-22

rouss, that was not for you, it was for the-boxhead (as he was trying to map 0 to s)


- prae5 - 2009-07-22

[QUOTE=rouss;373452
@spiff: Of course, that would be pointless but creating an infrared remote with a full keyboard that would allow the user to input text isn't pointless. My goal is not to map the "S" key to the zero key on the remote and have it function like pressing the "S" on a keyboard. The point would be to input text via infrared in XBMC when need be.[/quote]

Unless I am misunderstanding you, you can already do this

http://www.xbmc.org/wiki/?title=AdvancedSettings.xml#.3Cnavigatevirtualkeyboard.3E


- jmarshall - 2009-07-22

rouss: How it works is that in "keyboard entry mode" which is defined in CApplication::OnKey() I think - basically it depends on where you are in the UI - we don't pass through the button translator, and instead pass the key code directly as the action.

Thus, you'd have to first determine how and where you want "keyboard entry mode" to kick in for a start, and then pass the appropriate keycode as the action. You'll need to do the translation in buttontranslator.cpp.

As an example, you could just add what you need to buttontranslator.cpp and then in the VirtualKeyboard section of the keymap do your mapping there. This would only apply to the virtualkeyboard, however, and thus wouldn't apply to things such as edit controls.

Cheers,
Jonathan


- The-Boxhead - 2009-07-24

@JM - Thank you for clearing that up. yes i was trying to activate shutdown menu.

@Grumpy - Yeah im stupid Wink

But... Problems. The wiki is a little unclear on what file where...

I want to do this:
Code:
<zero>XBMC.ActivateWindow(shutdownmenu)</zero>

So the section in /home/xbmc/XBMC/system/keymaps/remote.xml is then:
Code:
<Home>
    <remote>
      <menu>XBMC.Skin.ToggleSetting(HomeViewToggle)</menu>
      <info>XBMC.ActivateWindow(SystemInfo)</info>
      <clear>XBMC.ActivateWindow(Weather)</clear>
      <hash>XBMC.ActivateWindow(Settings)</hash>
      <zero>XBMC.ActivateWindow(shutdownmenu)</zero>
    </remote>
</Home>

But that did not work. so i tried to copy the remote.xml to my
/home/xbmc/.xbmc/userdata/remote.xml
No joy so i tried to rename it since the wiki said the old name of "keymap.xml"
still worked for backward comp. That didnt work either.

and i dont have anything under /home/.xbmc/XBMC/system/

My debug log says:
Code:
00:13:42 T:3044894608 M:1427275776   DEBUG: OnKey: 206 pressed, action is 0

But no errors.. im stumped Wink


- Anastrophe - 2009-08-17

did you ever find the right way of doing this?