Using a Microsoft remote control in Windows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Kentyman
No edit summary
>Jhsrennie
(Complete rewrite for the Dharma release)
Line 1: Line 1:
See [[Using a remote control with XBMC]] for general notes on remote controllers.
Note that this article applies only to the Microsoft remote and full
compatibles. Specifically this means remotes that use the Microsoft
eHome driver. To see if your remote uses the eHome driver open Device
Manager and look under the heading <i>Universal Serial Bus
controllers</i> to see if there is a device called <i>eHome Infrared
Receiver</i>. For other remotes and general notes on remote controllers
see [[Using a remote control with XBMC]].


If you are using Windows then the official Microsoft MCE remote is
Any version of Windows from XP Windows XP onwards will automatically
very easy to use with XBMC because it can be configured to send any
detect and install a Microsoft remote as soon as you connect it. With
keystrokes you want. The only decision you have to make is whether you
versions of XBMC from v10.0 Dharma onwards most of the buttons on the
want it to remain compatible with Windows Media Center. If you do not
Microsoft remote will work immediately. The exceptions I know about
need compatibility with Windows Media Center then you can configure it
are:
to send the standard XBMC keypresses like <i>P</i> for <i>Play</i> and
<i>X</i> for <i>Stop</i> 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/.
<ul>
This contains detailed instructions for configuring the Microsoft
  <li>The Info button; sometimes labelled <i>More</i> or just <i>i</i>.
remote, and some .reg files that you can just double-click to apply a
  <li>The volume buttons will control the Windows volume setting not the XBMC volume</li>
suitable configuration.
  <li>The four coloured buttons (not all MS remotes have these) won't do anything</li>
  <li>With Vista/Windows 7 the Live TV, Recorded TV and Guide buttons will start Windows Media Center. With Windows XP (non-Media Center Edition) these buttons won't do anything</li>
  <li>The Green/Windows button will start Windows Media Center</li>
</ul>


There are various remotes around that claim to be fully MS
For most people this will be fine, and in that case you don't need to do
compatible and have the same registry keys as the MS remote. The config
anything further. The only reason for continuing with this article is
files in mceremote.zip should work with these remotes, but I have had
if you want to customise the Microsoft remote to change the actions of
occasional reports of remotes that stop working after applying the .reg
any of the buttons or to make the Info and coloured buttons work.
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.
== How the MS remote works ==


== Configuring the MS remote ==
The article [[Using a remote control with XBMC]] describes the four
ways that MCE remotes work in Windows. With the default eHome driver
the MS remotes uses a combination of all four ways:
 
<ol>
  <li>The <i>i</i> button and the coloured buttons send
  IR signals and won't do anything in XBMC.<br>&nbsp;</li>
 
  <li>The <i>Play</i>, <i>Pause</i> and various other buttons
  send APPCOMMAND messages. These messages are handled by XBMC so the
  buttons will work in XBMC.<br>&nbsp;</li>
 
  <li>Some of the buttons like <i>Stop</i> and the <i>Next</i> and
  <i>Prev</i> buttons send multimedia keyboard presses. It isn't
  obvious why MS chose to make some buttons send multimedia keypresses
  and others send APPCOMMAND messages. Anyhow, these buttons will
  work in XBMC.<br>&nbsp;</li>
 
  <li>The remaining buttons just send keypresses e.g. pressing the
  <i>5</i> button looks to Windows (and XBMC) as if you just pressed
  the <i>5</i> key on the keyboard. The only button that doesn't do
  the obvious is the <i>Clear</i> button, which sends the keypress
  <i>Escape</i>.</li>
</ol>


If you have a standard Microsoft MCE remote control you can configure
The Microsoft remote keeps the button configuration in the registry,
it to send whatever keystrokes you want by modifying the registry.
and you can configure the action of any of the buttons by editing the
registry. The remainder of this article describes how this can be done.


Why would you want to do this? Well if you use an app like XBMC it's
This article refers to various configuration files that are included
easier to configure it to accept input from the remote if the remote
with the MCERemote Addon for XBMC. At the time of writing this addon
sends keystrokes.
can be downloaded from http://xbmcmce.sourceforge.net/ and it will
one day be added to the XBMC.org addon repository. You don't need to
install the addon to get at the config files. Just unzip it, and you'll
find the files in plugin.script.mceremote\resources\data.


== To install the config ==
== Configuring the MS remote ==


First back up your existing config so you can put it back if things go
The gory details are in the ReadMe.txt included with the MCERemote
wrong. Open Registry Editor and navigate to the key:
addon. In brief, the eHome driver keeps the button configuration in the
registry value <i>ReportMappingTable</i> in the key:


<pre>HKEY_LOCAL_MACHINE
<pre>HKEY_LOCAL_MACHINE
Line 48: Line 78:
       \745a17a0-74d3-11d0-b6fe-00a0c90f57da</pre>
       \745a17a0-74d3-11d0-b6fe-00a0c90f57da</pre>


If this key doesn't exist stop right now because this config won't
This is a binary value, and it's in an abscure format. See the
work. The only reason I know why you might not have this key in the
ReadMe.txt in the MCERemote addon for full details. For the purposes of
registry is if your remote is not a standard MS remote or you're not
this article you just need to know that the addon includes two
using the standard MS driver.
<i>.reg</i> files that you can run to update the button configuration:
 
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 MSRemote.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. 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>
 
== 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>
 
== Remote-Sendkeys.reg ==
 
<pre>Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da]
<dl>
"ReportMappingTable"=hex:\
   <dt>MSRemote.reg</dt>
   00,00,00,00,04,00,27,\ ; 0
   <dd>This will configure all the buttons on the remote to send the Media
   01,00,00,00,04,00,1e,\ ; 1
   Centre shortcut keys e.g. ctrl-shift-P for <i>Play</i>. XBMC handles
  02,00,00,00,04,00,1f,\ ; 2
   all these keys though some, like the <i>Live TV</i> keypress, ctrl-T,
  03,00,00,00,04,00,20,\ ; 3
   won't do anything useful until PVR support is added to XBMC. The remote
  04,00,00,00,04,00,21,\ ; 4
   will continue to work normally with Windows Media Center. In the
  05,00,00,00,04,00,22,\ ; 5
   unlikely event that you're interested see
  06,00,00,00,04,00,23,\ ; 6
   http://msdn.microsoft.com/en-us/library/bb189249.aspx for a list of
  07,00,00,00,04,00,24,\ ; 7
   (most of) the Media Center keyboard shortcuts.<br>&nbsp;</dd>
  08,00,00,00,04,00,25,\ ; 8
  09,00,00,00,04,00,26,\ ; 9
  0a,00,00,00,04,00,29,\ ; Clear - sends escape
  0b,00,00,00,04,00,28,\ ; Enter - sends return
  0c,00,00,00,04,04,3d,\ ; Power    - was "03,82,00" sends alt-F4
  0e,00,00,00,04,00,41,\ ; Mute      - was "01,e2,00" sends F8
  0f,00,00,00,01,09,02,\ ; Info
  10,00,00,00,04,00,43,\ ; vol up    - was "01,e9,00" sends F10
  11,00,00,00,04,00,42,\ ; vol down  - was "01,ea,00" sends F9
  12,00,00,00,04,01,2e,\ ; chan up  - was "01,9c,00" sends ctrl-equals(plus)
  13,00,00,00,04,01,2d,\ ; chan down - was "01,9d,00" sends ctrl-hyphen(minus)
  14,00,00,00,04,03,09,\ ; ff        - was "01,b3,00" sends ctrl-shift-F
  15,00,00,00,04,03,05,\ ; rew      - was "01,b4,00" sends ctrl-shift-B
   16,00,00,00,04,03,13,\ ; play      - was "01,b0,00" sends ctrl-shift-P
   17,00,00,00,01,b2,00,\ ; record
  18,00,00,00,04,01,13,\ ; pause    - was "01,b1,00" sends ctrl-P
  19,00,00,00,04,03,16,\ ; stop      - was "01,b7,00" sends ctrl-shift-S
   1a,00,00,00,04,01,09,\ ; next      - was "01,b5,00" sends ctrl-F
   1b,00,00,00,04,01,05,\ ; prev      - was "01,b6,00" sends ctrl-B
   1c,00,00,00,04,02,20,\ ; # (shift-3)
   1d,00,00,00,04,02,25,\ ; * (shift-8)
  1e,00,00,00,04,00,52,\ ; up
  1f,00,00,00,04,00,51,\ ; down
  20,00,00,00,04,00,50,\ ; left
  21,00,00,00,04,00,4f,\ ; right
   22,00,00,00,04,00,28,\ ; OK (return)
  23,00,00,00,04,00,2a,\ ; back      - was "01,24,02" sends Backspace
  24,00,00,00,04,03,10,\ ; DVD menu - sends ctrl-shift-M
  25,00,00,00,04,03,17,\ ; Live TV - sends ctrl-shift-T
  26,00,00,00,04,01,0a,\ ; Guide - was "01,8d,00" sends ctrl-G
  48,00,00,00,04,01,12  ; Recorded TV - sends ctl-O</pre>


== Remote-XBMC.reg ==
  <dt>MSDefault.reg</dt>
  <dd>This restores the default eHome button configuration. You can use
  this to back to the default settings in case there is any problem with
  changing the button config.</dd>
</dl>


<pre>Windows Registry Editor Version 5.00
If you want to change the button config first check that the registry
key mentioned above exists. If the registry key isn't present this means
your remote is not using the eHome driver and the registry files won't
work (though they won't do any harm). Assuming the registry key is
present just run the appropriate .reg files and answer <i>Yes</i> when
it asks if you're sure you want to make the changes. You need to
restart Windows for the changes to take effect.


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da]
The MCERemote addon includes an applet called ShowKey that shows you
"ReportMappingTable"=hex:\
what the buttons on the remote are doing. Run ShowKey.exe and press any
  00,00,00,00,04,00,27,\ ; 0
button on the remote. ShowKey will show you if that button is sending a
  01,00,00,00,04,00,1e,\ ; 1
keystroke or an APPCOMMAND message. If the button doesn't send a
  02,00,00,00,04,00,1f,\ ; 2
keypress or message ShowKey won't detect the button press.
  03,00,00,00,04,00,20,\ ; 3
  04,00,00,00,04,00,21,\ ; 4
  05,00,00,00,04,00,22,\ ; 5
  06,00,00,00,04,00,23,\ ; 6
  07,00,00,00,04,00,24,\ ; 7
  08,00,00,00,04,00,25,\ ; 8
  09,00,00,00,04,00,26,\ ; 9
  0a,00,00,00,04,00,29,\ ; Clear - sends escape
  0b,00,00,00,04,00,28,\ ; Enter - sends return
  0c,00,00,00,04,04,3d,\ ; Power - was "03,82,00" sends alt-F4
  0d,00,00,00,04,03,1b,\ ; Windows - sends ctrl-shift-X
  0e,00,00,00,01,e2,00,\ ; Mute - doesn't send a key
  0f,00,00,00,04,00,06,\ ; Info - was "01,09,02" sends C (context menu)
  10,00,00,00,04,00,57,\ ; vol up    - was "01,e9,00" sends Keypad +
  11,00,00,00,04,00,56,\ ; vol down  - was "01,ea,00" sends Keypad -
  12,00,00,00,04,00,37,\ ; chan up  - was "01,9c,00" sends .
  13,00,00,00,04,00,36,\ ; chan down - was "01,9d,00" sends ,
  14,00,00,00,04,00,09,\ ; ff        - was "01,b3,00" sends F
  15,00,00,00,04,00,15,\ ; rew      - was "01,b4,00" sends R
  16,00,00,00,04,00,13,\ ; play      - was "01,b0,00" sends P
  17,00,00,00,04,01,15,\ ; record    - was "01,b2,00" sends ctrl-R
  18,00,00,00,04,00,2c,\ ; pause    - was "01,b1,00" sends space
  19,00,00,00,04,00,1b,\ ; stop      - was "01,b7,00" sends X
  1a,00,00,00,04,00,37,\ ; next      - was "01,b5,00" sends .
  1b,00,00,00,04,00,36,\ ; prev      - was "01,b6,00" sends ,
  1c,00,00,00,04,02,20,\ ; # (shift-3)
  1d,00,00,00,04,02,25,\ ; * (shift-8)
  1e,00,00,00,04,00,52,\ ; up
  1f,00,00,00,04,00,51,\ ; down
  20,00,00,00,04,00,50,\ ; left
  21,00,00,00,04,00,4f,\ ; right
  22,00,00,00,04,00,28,\ ; OK (return)
  23,00,00,00,04,00,2a,\ ; back - was "01,24,02" sends Backspace
  24,00,00,00,04,03,10,\ ; DVD menu - sends ctrl-shift-M
  25,00,00,00,04,03,17,\ ; Live TV - sends ctrl-shift-T
  26,00,00,00,04,01,0a,\ ; Guide - was "01,8d,00" sends ctrl-G
  48,00,00,00,04,01,12,\ ; Recorded TV - sends ctl-O
  5B,00,00,00,04,01,04,\ ; Red    - sends ctrl-A
  5C,00,00,00,04,01,05,\ ; Green  - sends ctrl-B
  5D,00,00,00,04,01,06,\ ; Yellow - sends ctrl-C
  5E,00,00,00,04,01,07  ; Blue  - sends ctrl-D</pre>


[[category:Remote]]
[[category:Remote]]

Revision as of 10:50, 14 October 2010

Note that this article applies only to the Microsoft remote and full compatibles. Specifically this means remotes that use the Microsoft eHome driver. To see if your remote uses the eHome driver open Device Manager and look under the heading Universal Serial Bus controllers to see if there is a device called eHome Infrared Receiver. For other remotes and general notes on remote controllers see Using a remote control with XBMC.

Any version of Windows from XP Windows XP onwards will automatically detect and install a Microsoft remote as soon as you connect it. With versions of XBMC from v10.0 Dharma onwards most of the buttons on the Microsoft remote will work immediately. The exceptions I know about are:

  • The Info button; sometimes labelled More or just i.
  • The volume buttons will control the Windows volume setting not the XBMC volume
  • The four coloured buttons (not all MS remotes have these) won't do anything
  • With Vista/Windows 7 the Live TV, Recorded TV and Guide buttons will start Windows Media Center. With Windows XP (non-Media Center Edition) these buttons won't do anything
  • The Green/Windows button will start Windows Media Center

For most people this will be fine, and in that case you don't need to do anything further. The only reason for continuing with this article is if you want to customise the Microsoft remote to change the actions of any of the buttons or to make the Info and coloured buttons work.

How the MS remote works

The article Using a remote control with XBMC describes the four ways that MCE remotes work in Windows. With the default eHome driver the MS remotes uses a combination of all four ways:

  1. The i button and the coloured buttons send IR signals and won't do anything in XBMC.
     
  2. The Play, Pause and various other buttons send APPCOMMAND messages. These messages are handled by XBMC so the buttons will work in XBMC.
     
  3. Some of the buttons like Stop and the Next and Prev buttons send multimedia keyboard presses. It isn't obvious why MS chose to make some buttons send multimedia keypresses and others send APPCOMMAND messages. Anyhow, these buttons will work in XBMC.
     
  4. The remaining buttons just send keypresses e.g. pressing the 5 button looks to Windows (and XBMC) as if you just pressed the 5 key on the keyboard. The only button that doesn't do the obvious is the Clear button, which sends the keypress Escape.

The Microsoft remote keeps the button configuration in the registry, and you can configure the action of any of the buttons by editing the registry. The remainder of this article describes how this can be done.

This article refers to various configuration files that are included with the MCERemote Addon for XBMC. At the time of writing this addon can be downloaded from http://xbmcmce.sourceforge.net/ and it will one day be added to the XBMC.org addon repository. You don't need to install the addon to get at the config files. Just unzip it, and you'll find the files in plugin.script.mceremote\resources\data.

Configuring the MS remote

The gory details are in the ReadMe.txt included with the MCERemote addon. In brief, the eHome driver keeps the button configuration in the registry value ReportMappingTable in the key:

HKEY_LOCAL_MACHINE
 \SYSTEM
  \CurrentControlSet
   \Services
    \HidIr
     \Remotes
      \745a17a0-74d3-11d0-b6fe-00a0c90f57da

This is a binary value, and it's in an abscure format. See the ReadMe.txt in the MCERemote addon for full details. For the purposes of this article you just need to know that the addon includes two .reg files that you can run to update the button configuration:

MSRemote.reg
This will configure all the buttons on the remote to send the Media Centre shortcut keys e.g. ctrl-shift-P for Play. XBMC handles all these keys though some, like the Live TV keypress, ctrl-T, won't do anything useful until PVR support is added to XBMC. The remote will continue to work normally with Windows Media Center. In the unlikely event that you're interested see http://msdn.microsoft.com/en-us/library/bb189249.aspx for a list of (most of) the Media Center keyboard shortcuts.
 
MSDefault.reg
This restores the default eHome button configuration. You can use this to back to the default settings in case there is any problem with changing the button config.

If you want to change the button config first check that the registry key mentioned above exists. If the registry key isn't present this means your remote is not using the eHome driver and the registry files won't work (though they won't do any harm). Assuming the registry key is present just run the appropriate .reg files and answer Yes when it asks if you're sure you want to make the changes. You need to restart Windows for the changes to take effect.

The MCERemote addon includes an applet called ShowKey that shows you what the buttons on the remote are doing. Run ShowKey.exe and press any button on the remote. ShowKey will show you if that button is sending a keystroke or an APPCOMMAND message. If the button doesn't send a keypress or message ShowKey won't detect the button press.