Using a Microsoft remote control in Windows: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Jhsrennie
No edit summary
>Jhsrennie
Line 59: Line 59:
       \745a17a0-74d3-11d0-b6fe-00a0c90f57da</pre>
       \745a17a0-74d3-11d0-b6fe-00a0c90f57da</pre>


This is a binary value
This is a binary array consisting of rows of 7 bytes. Each row defines
one button. The seven bytes in the row are:
 
<table>
  <tr><td><b>Byte</b><td><b>Action</b></td></tr>
  <tr><td>0</td><td>button number (see below)</td></tr>
  <tr><td>1</td><td>always 0</td></tr>
  <tr><td>2</td><td>always 0</td></tr>
  <tr><td>3</td><td>always 0</td></tr>
  <tr><td>4</td><td>04 sends a keystroke</td></tr>
  <tr><td>5</td><td>key modifier (see below)</td></tr>
  <tr><td>6</td><td>keystroke (see below)</td></tr>
</table>
 
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:
 
<table>
  <tr><td><b>Byte</b><td><b>Action</b></td></tr>
  <tr><td>0</td><td>No modifier</td></tr>
  <tr><td>1</td><td>Control</td></tr>
  <tr><td>2</td><td>Shift</td></tr>
  <tr><td>3</td><td>Control-Shift</td></tr>
  <tr><td>4</td><td>Alt</td></tr>
  <tr><td>5</td><td>Control-Alt</td></tr>
  <tr><td>6</td><td>Shift-Alt</td></tr>
  <tr><td>7</td><td>Control-Shift-Alt</td></tr>
  <tr><td>8</td><td>Windows</td></tr>
  <tr><td>9</td><td>Control-Windows</td></tr>
  <tr><td>a</td><td>Shift-Windows</td></tr>
  <tr><td>b</td><td>Control-Shift-Windows</td></tr>
  <tr><td>c</td><td>Alt-Windows</td></tr>
  <tr><td>d</td><td>Control-Alt-Windows</td></tr>
  <tr><td>e</td><td>Shift-Alt-Windows</td></tr>
  <tr><td>f</td><td>Control-Shift-Alt-Windows</td></tr>
</table>
 
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
 
 


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

Revision as of 09:18, 29 November 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 Human Interface Devices to see if there is a device called Microsoft eHome Infrared Transceiver. For other remotes and general notes on remote controllers see Using a remote control with XBMC.

Any version of Windows from 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.

Useful resources

EliteGamer360 has written a registry config file and associated keyboard.xml and these are available from http://xbmccustomregis.sourceforge.net/.

jhsrennie has written an add-on to configure MS remotes. To install it run XBMC and go to Settings, Add-ons, Get Add-ons, XBMC.org Add-ons, Program Add-ons and select MCERemote. Once installed, you can open the add-on by selecting Programs from the home page then MCERemote. The addon includes an option to display the instructions.

http://xbmcmce.sourceforge.net/ has various utilities to help with tweaking the button mapping. ShowKey will show you what keypresses or AppCommand messages are being sent, and KeyMapEdit is a utility for editing the keyboard.xml file.

The remainder of this article describes the gory details of configuring the Microsoft remote. This probably looks frighteningly complicated to most of us, but very few people need to read further as EliteGamer360's scripts and/or the MCERemote add-on should do everything you need. Only the curious and determined need read further.

How the MS remote works

The Microsoft remote, or more accurately the eHome device 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 array consisting of rows of 7 bytes. Each row defines one button. The seven bytes in the row are:

ByteAction
0button number (see below)
1always 0
2always 0
3always 0
404 sends a keystroke
5key modifier (see below)
6keystroke (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:

ByteAction
0No modifier
1Control
2Shift
3Control-Shift
4Alt
5Control-Alt
6Shift-Alt
7Control-Shift-Alt
8Windows
9Control-Windows
aShift-Windows
bControl-Shift-Windows
cAlt-Windows
dControl-Alt-Windows
eShift-Alt-Windows
fControl-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