Using a Microsoft remote control in Windows: Difference between revisions
>Jhsrennie No edit summary |
>Jhsrennie No edit summary |
||
Line 23: | Line 23: | ||
the registry. Then if the remote stops working you can go back to that | the registry. Then if the remote stops working you can go back to that | ||
restore point. | restore point. | ||
The following is from the mceremote.zip file described above. | |||
== Configuring the MS remote == | |||
If you have a standard Microsoft MCE remote control you can configure | |||
it to send whatever keystrokes you want by modifying the registry. | |||
Why would you want to do this? Well if you use an app like XBMC it's | |||
easier to configure it to accept input from the remote if the remote | |||
sends keystrokes. | |||
I've included two configs at the end of this article. The file Remote-SendKeys.reg | |||
will configure the remote to send the standard MCE keystrokes when you | |||
press the Play, Pause, Stop, etc buttons, instead of just sending an IR | |||
command. With this config the remote should still work with Windows | |||
Media Center. | |||
The file Remote-XBMC.reg will configure the remote to send the standard | |||
XBMX keystrokes e.g. P for "play" and X for "stop". This will make the | |||
remote work seamlessly with XBMC, but it will no longer work with | |||
Windows Media Center. | |||
== To install the config == | |||
First back up your existing config so you can put it back if things go | |||
wrong. Open Registry Editor and navigate to the key: | |||
<pre>HKEY_LOCAL_MACHINE | |||
\SYSTEM | |||
\CurrentControlSet | |||
\Services | |||
\HidIr | |||
\Remotes | |||
\745a17a0-74d3-11d0-b6fe-00a0c90f57da</pre> | |||
If this key doesn't exist stop right now because this config won't | |||
work. The only reason I know why you might not have this key in the | |||
registry is if your remote is not a standard MS remote or you're not | |||
using the standard MS driver. | |||
Assuming the key exists, right click on it and choose Export. Save the | |||
key to a .reg file and make sure you keep this file safe. If anything | |||
goes wrong you can double-click your exported .reg file and it will | |||
restore the key back to the default state. | |||
Now just double-click Remote-SendKeys.reg or Remote-XBMC.reg and answer | |||
yes when it asks if you're sure. Now reboot your PC and the remote | |||
should now be sending keystrokes. | |||
I've written an applet, Showkey.exe, for testing the remote. You will | |||
need to download mceremote.zip to get a copy of the app. If you | |||
run this applet then press buttons on the remote the applet will show | |||
what keystroks it's receiving. Using Remote-SendKeys.reg the keystrokes | |||
should be: | |||
<pre>play - ctrl-shift-P | |||
pause - ctrl-P | |||
stop - ctrl-shift-S | |||
ff - ctrl-shift-F | |||
rew - ctrl-shift-B | |||
next - ctrl-F | |||
prev - ctrl-B</pre> | |||
With Remote-XBMC.reg the keystrokes should be: | |||
<pre>play - P | |||
pause - space | |||
stop - X | |||
ff - F | |||
rew - R | |||
next - . | |||
prev - ,</pre> | |||
== The boring details == | |||
The registry mod changes the value "ReportMappingTable". This is a | |||
binary array consisting of rows of 7 bytes. Each row defines one | |||
button. The seven bytes in the row are: | |||
<pre>Byte Action | |||
---- ------ | |||
0 button number (see below) | |||
1 always 0 | |||
2 always 0 | |||
3 always 0 | |||
4 04 sends a keystroke | |||
5 key modifier (see below) | |||
6 keystroke (see below)</pre> | |||
Byte 4 can be 01 or 03. These sends IR codes not keystrokes and I'm | |||
ignoring these values in this article. I'm only interested in setting | |||
byte 4 to "04" to indicate a keystroke. | |||
Byte 5, the key modifier, specifies if control, shift etc are down when | |||
the key is sent. The value can be: | |||
<pre>Byte Action | |||
---- ------ | |||
0 No modifier | |||
1 Control | |||
2 Shift | |||
3 Control-Shift | |||
4 Alt | |||
5 Control-Alt | |||
6 Shift-Alt | |||
7 Control-Shift-Alt | |||
8 Windows | |||
9 Control-Windows | |||
a Shift-Windows | |||
b Control-Shift-Windows | |||
c Alt-Windows | |||
d Control-Alt-Windows | |||
e Shift-Alt-Windows | |||
f Control-Shift-Alt-Windows</pre> | |||
If you're happy with binary numbers you've probably spotted that bit 0 | |||
specifies Control, bit 1 specifies Shift, bit 2 specifies Alt and bit 3 | |||
specifies the Windows key. | |||
The keystroke is not an ACSII code or a scan code. It's an arbitrary | |||
code selected by MS. You can find a list of the codes in | |||
http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf | |||
== Button number == | |||
This is a list of all the button numbers you can use in the registry config. | |||
In mceremote.zip I've included a picture of the standard MS remote with the button | |||
numbers superimposed. | |||
The button numbers are: | |||
<pre>Number Button | |||
00 0 | |||
01 1 | |||
02 2 | |||
03 3 | |||
04 4 | |||
05 5 | |||
06 6 | |||
07 7 | |||
08 8 | |||
09 9 | |||
0a Clear | |||
0b Enter | |||
0c Power | |||
0d Windows | |||
0e Mute | |||
0f Info | |||
10 vol up | |||
11 vol down | |||
12 chan up | |||
13 chan down | |||
14 ff | |||
15 rew | |||
16 play | |||
17 record | |||
18 pause | |||
19 stop | |||
1a next | |||
1b prev | |||
1c # | |||
1d * | |||
1e up | |||
1f down | |||
20 left | |||
21 right | |||
22 OK (return) | |||
23 back | |||
24 DVD menu | |||
25 Live TV | |||
26 Guide | |||
48 Recorded TV | |||
5B Red | |||
5C Green | |||
5D Yellow | |||
5E Blue</pre> |
Revision as of 10:04, 13 January 2010
See Using a remote control with XBMC for general notes on remote controllers.
If you are using Windows then the official Microsoft MCE remote is very easy to use with XBMC because it can be configured to send any keystrokes you want. The only decision you have to make is whether you want it to remain compatible with Windows Media Center. If you do not need compatibility with Windows Media Center then you can configure it to send the standard XBMC keypresses like P for Play and X for Stop and it will work with any version of XBMC; even old ones. If you do need compatibility with Windows Media Center you can configure the remote to send the standard MCE keyboard shortcuts, in which case you will need XBMC build 26407 or later.
Start by downloading mceremote.zip from http://xbmcmce.sourceforge.net/. This contains detailed instructions for configuring the Microsoft remote, and some .reg files that you can just double-click to apply a suitable configuration.
There are various remotes around that claim to be fully MS compatible and have the same registry keys as the MS remote. The config files in mceremote.zip should work with these remotes, but I have had occasional reports of remotes that stop working after applying the .reg files. It would be worth creating a restore point before meddling with the registry. Then if the remote stops working you can go back to that restore point.
The following is from the mceremote.zip file described above.
Configuring the MS remote
If you have a standard Microsoft MCE remote control you can configure it to send whatever keystrokes you want by modifying the registry.
Why would you want to do this? Well if you use an app like XBMC it's easier to configure it to accept input from the remote if the remote sends keystrokes.
I've included two configs at the end of this article. The file Remote-SendKeys.reg will configure the remote to send the standard MCE keystrokes when you press the Play, Pause, Stop, etc buttons, instead of just sending an IR command. With this config the remote should still work with Windows Media Center.
The file Remote-XBMC.reg will configure the remote to send the standard XBMX keystrokes e.g. P for "play" and X for "stop". This will make the remote work seamlessly with XBMC, but it will no longer work with Windows Media Center.
To install the config
First back up your existing config so you can put it back if things go wrong. Open Registry Editor and navigate to the key:
HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \HidIr \Remotes \745a17a0-74d3-11d0-b6fe-00a0c90f57da
If this key doesn't exist stop right now because this config won't work. The only reason I know why you might not have this key in the registry is if your remote is not a standard MS remote or you're not using the standard MS driver.
Assuming the key exists, right click on it and choose Export. Save the key to a .reg file and make sure you keep this file safe. If anything goes wrong you can double-click your exported .reg file and it will restore the key back to the default state.
Now just double-click Remote-SendKeys.reg or Remote-XBMC.reg and answer yes when it asks if you're sure. Now reboot your PC and the remote should now be sending keystrokes.
I've written an applet, Showkey.exe, for testing the remote. You will need to download mceremote.zip to get a copy of the app. If you run this applet then press buttons on the remote the applet will show what keystroks it's receiving. Using Remote-SendKeys.reg the keystrokes should be:
play - ctrl-shift-P pause - ctrl-P stop - ctrl-shift-S ff - ctrl-shift-F rew - ctrl-shift-B next - ctrl-F prev - ctrl-B
With Remote-XBMC.reg the keystrokes should be:
play - P pause - space stop - X ff - F rew - R next - . prev - ,
The boring details
The registry mod changes the value "ReportMappingTable". This is a binary array consisting of rows of 7 bytes. Each row defines one button. The seven bytes in the row are:
Byte Action ---- ------ 0 button number (see below) 1 always 0 2 always 0 3 always 0 4 04 sends a keystroke 5 key modifier (see below) 6 keystroke (see below)
Byte 4 can be 01 or 03. These sends IR codes not keystrokes and I'm ignoring these values in this article. I'm only interested in setting byte 4 to "04" to indicate a keystroke.
Byte 5, the key modifier, specifies if control, shift etc are down when the key is sent. The value can be:
Byte Action ---- ------ 0 No modifier 1 Control 2 Shift 3 Control-Shift 4 Alt 5 Control-Alt 6 Shift-Alt 7 Control-Shift-Alt 8 Windows 9 Control-Windows a Shift-Windows b Control-Shift-Windows c Alt-Windows d Control-Alt-Windows e Shift-Alt-Windows f Control-Shift-Alt-Windows
If you're happy with binary numbers you've probably spotted that bit 0 specifies Control, bit 1 specifies Shift, bit 2 specifies Alt and bit 3 specifies the Windows key.
The keystroke is not an ACSII code or a scan code. It's an arbitrary code selected by MS. You can find a list of the codes in
http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
Button number
This is a list of all the button numbers you can use in the registry config. In mceremote.zip I've included a picture of the standard MS remote with the button numbers superimposed.
The button numbers are:
Number Button 00 0 01 1 02 2 03 3 04 4 05 5 06 6 07 7 08 8 09 9 0a Clear 0b Enter 0c Power 0d Windows 0e Mute 0f Info 10 vol up 11 vol down 12 chan up 13 chan down 14 ff 15 rew 16 play 17 record 18 pause 19 stop 1a next 1b prev 1c # 1d * 1e up 1f down 20 left 21 right 22 OK (return) 23 back 24 DVD menu 25 Live TV 26 Guide 48 Recorded TV 5B Red 5C Green 5D Yellow 5E Blue