Using an MCE remote: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Jhsrennie
(New page: Note: this article refers to build 26407 and later. Earlier versions of XBMC did not have all the features described in this and related articles. The first offical release of XBMC with th...)
 
No edit summary
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Note: this article refers to build 26407 and later. Earlier versions
{{incomplete}}
of XBMC did not have all the features described in this and related
{{cleanup}}
articles. The first offical release of XBMC with this remote support
Note: this article assumes you are using XBMC v10.0 Dharma or a later  
will be v10.05.
version. Earlier versions of XBMC such as v9.11 Camelot do not support key modifiers
like control, shift and alt so the key mappings required for Media Center
Remotes will not work.


If you have one of the many cheap MCE remote controllers then just
If you have one of the many cheap MCE remote controllers then just
Line 14: Line 16:


<ul>
<ul>
   <li>Using the official MS remote with XBMC on Windows</li>
   <li>[[Using a Microsoft remote control in Windows]]</li>
   <li>Using non-MS remotes with XBMC on Windows</li>
   <li>[[Using an MCE remote control in Windows]]</li>
  <li>Using remote controllers with XBMC on Linux</li>
</ul>
</ul>


Line 22: Line 23:
article I recommend that you take the time to do it. Once you've read
article I recommend that you take the time to do it. Once you've read
this article the articles above will make more sense.
this article the articles above will make more sense.


Media Center remotes are obviously designed to work with Microsoft
Media Center remotes are obviously designed to work with Microsoft
Line 32: Line 34:
controllers using software called Lirc. Assuming there is a Linux
controllers using software called Lirc. Assuming there is a Linux
driver for your remote controller you can configure Lirc to use it with
driver for your remote controller you can configure Lirc to use it with
XBMC. Details are in the Linux article above. Note that XBMCLive is
XBMC. Note that XBMCLive is
already configured to work with the official MS remote. Sadly, on
already configured to work with the official MS remote. Sadly, on
Windows the situation is a lot more confused.
Windows the situation is a lot more confused.


== Why there is a problem (on Windows) ... ==
== Why there is a problem (on Windows) ... ==
Line 48: Line 49:
<ol>
<ol>
   <li>The remote can send an IR code like the Microsoft remote. To use
   <li>The remote can send an IR code like the Microsoft remote. To use
   the remote an application has to link to the IR driver.<br>&nbsp;</li>
   the remote an application has to link to the IR driver.<br />&nbsp;</li>


   <li>The remote can send the Windows message WM_APPCOMMAND. This
   <li>The remote can send the Windows message WM_APPCOMMAND. This
   message is used to send a multimedia application messages like "Play",
   message is used to send a multimedia application messages like "Play",
   "Pause", "Stop" etc. To use this type of remote an application has to
   "Pause", "Stop" etc. To use this type of remote an application has to
   process the WM_APPCOMMAND messages.<br>&nbsp;</li>
   process the WM_APPCOMMAND messages.<br />&nbsp;</li>


   <li>The remote can simulate multimedia keypresses when you press a
   <li>The remote can simulate multimedia key presses when you press a
   button. Multimedia keys were introduced with the Microsoft multimedia
   button. Multimedia keys were introduced with the Microsoft multimedia
   keyboard, which has extra keys for multimedia functions like "Play"
   keyboard, which has extra keys for multimedia functions like "Play"
   etc. To use this type of remote an application has to process the
   etc. To use this type of remote an application has to process the
   multimedia keypresses.<br>&nbsp;</li>
   multimedia keypresses.<br />&nbsp;</li>


   <li>Finally the remote can simulate the standard MS Media Center
   <li>Finally the remote can simulate the standard MS Media Center
Line 66: Line 67:
   example control-shift-P means "Play". Many cheap MCE remotes simulate
   example control-shift-P means "Play". Many cheap MCE remotes simulate
   these keyboard shortcuts e.g. when you press the Play button they
   these keyboard shortcuts e.g. when you press the Play button they
   simulate the keypress control-shift-P. To use this type of remote an
   simulate the key press control-shift-P. To use this type of remote an
   application has to process the Media Center keypresses.<br>&nbsp;</li>
   application has to process the Media Center key presses.</li>
</ol>
</ol>


== ... and how to solve it ==
== ... and how to solve it ==
Line 79: Line 79:
include extra keys not on the official MS remote, and to get these to do
include extra keys not on the official MS remote, and to get these to do
anything you will need some manual configuration. All this is covered in
anything you will need some manual configuration. All this is covered in
the article on using non-MS remotes.
[[Using an MCE remote control in Windows]].


Ironically the official MS remote will not work with XBMC out of the
Ironically the official MS remote will not work with XBMC out of the
box. This is because it uses IR codes i.e. type 1 in the list above,
box, or rather it will partially work: some buttons will work while others won't.
This is because the MS remote uses IR codes i.e. type 1 in the list above,
and XBMC does not support this. The good news is that the MS remote is
and XBMC does not support this. The good news is that the MS remote is
easily reconfigured to work as a type 4 remote instead. This is covered
easily reconfigured to work as a type 4 remote instead. This is covered
in the article on using the MS remote.
in the article [[Using a Microsoft remote control in Windows]].
 


== A note on Linux ==
== A note on Linux ==


to be completed
Remotes of type 3 and 4 will probably work on Linux out of the box, provided
 
Linux sees the remote as a keyboard sending MCE keys. Some brief testing
 
with a handful of cheap remotes showed they all work.
== How it works ==
 
Actually supporting the type 2 and 3 remotes is quite easy, and
version 9.11 (Camelot) of XBMC already includes partial support for
these types. The only changes in the post 26407 builds just extend the
WM_APPCOMMAMD processing a bit. It's handling the type 4 remotes that
is hard. This is because type 4 remotes send combinations of keypresses
with modifier keys like Control and Shift. The key handler in XBMC
v9.11 and earlier cannot process the key modifiers so it can't process
the simulated keypresses sent by the type 4 remotes. The later builds
include support for key modifiers and add the Media Center keyboard
shortcuts to the key mapping file.
 
 
== If you can't wait for v10.05 ==
 
The remote controller support described above will be included
in XBMC version 10.05. If you can't wait that long you'll need to
build the latest version of XBMC yourself. If you don't have the
development tools (or skills) to compile XBMC yourself there are
several people around who provide development builds. See
<a href="http://forum.xbmc.org/showthread.php?t=62109">
http://forum.xbmc.org/showthread.php?t=62109</a> for example.
Alternatively there is an unofficial Windows build of v9.11
with key modifier support retro-fitted at
<a href="http://xbmcmce.sourceforge.net/">xbmcmce.sourceforge.net</a>.
 
 
== Configuring the keyboard ==
 
You're into nerd (OK, "enthusiast") territory now. This section
described how to manually edit the key mappings in XBMC. You will only
need to do this if your remote sends non-standard keypresses, or if you
want to use non-standard buttons on the remote. If you are going to do
this make sure you read the article on using non-MS remotes first.
 
The mapping of keypresses like <i>P</i> to XBMC actions like
<i>Play</i> is configured in a file called keyboard.xml. There is a
copy of keyboard.xml in C:\Program Files\XBMC\system\keymaps, and the
settings in this file apply to all users. In general you shouldn't edit
or replace this file because any mistakes you make can be hard to undo.
At the very least make a backup copy of the file before you change
anything.
 
If you want to change the key mapping you can create a second
keyboard.xml file in your userdata/keymaps folder (see below for where
this folder is). XBMC combines the system keyboard.xml with your
userdata keyboard.xml so you only need to add any extra keys; you don't
need to duplicate all the key definitions already in the system
keyboard.xml. You can also override any key definitions in the
system keyboard.xml by putting the new definition in your userdata
keyboard.xml.
 
If you use Linux then your userdata folder is $home/.xbmc/userdata
so the full path to your keyboard.xml file is
$home/.xbmc/userdata/keymaps/keyboard.xml.
 
If you use Windows the situation is a bit more complicated because
it depends on whether you installed XBMC in default mode or portable
mode. In portable mode the path to the file is
C:\Program&nbsp;Files\XBMC\userdata\keymaps\keyboard.xml. In default
mode the file is in your profile, in
%APPDATA%\XBMC\userdata\keymaps\keyboard.xml, where APPDATA is an
environment variable. In both default and portable mode, if the
keymaps folder doesn't exist in your userdata folder just create
it.
 
A side note: if you are using the 64 bit versions of Windows replace
C:\Program&nbsp;Files\ by C:\Program&nbsp;Files&nbsp;(x86)\. If you
didn't install XBMC into the Program&nbsp;Files folder then replace
C:\Program&nbsp;Files\XBMC\ by whatever directory you chose at
installation.
 
== Modifying keyboard.xml ==


The keyboard.xml file is just a text file and can be edited in any
== What to do next ==
text editor like Notepad in Windows or gedit in Linux. One day there
will be a nice GUI app for editing keyboard.xml, but for now you need to
do it by hand.


The first step is to create the keyboard.xml file in
If you have a type 1 remote such as the Microsoft remote, or one
userdata\keymaps. If there isn't a keymaps folder in userdata then
of the remotes compatible with it, see
create one now. To get you started there is a sample keyboard.xml
[[Using a Microsoft remote control in Windows]].
<a href="keyboard.xml">here</a> with key mappings for the standard
Media Center keyboard shortcuts. In many cases just copying this
file into userdata\keymaps will be enough to get your remote
working.


If you make a mistake in the keyboard.xml XBMC will probably just
If you have a type 2, 3 or 4 remote then it will probably work
ignore it and none of your extra keymappings will work. If you think
without any messing around. You might want to modify the key
this has happened look in the xbmc.log file for an error like:
mappings for the myriad of extra buttons on a typical MCE clone remote.
In that case see [[Using an MCE remote control in Windows]] for
an introduction, or go straight to [[HOW-TO:Modify_keymaps|Modifying keyboard.xml]]
if you want to jump straight in and start modifying the key
mappings.


<pre>ERROR: Error loading keymap: special://masterprofile/keymaps/keyboard.xml, Line 16
[[Category:Remotes]]
      Error reading end tag.
ERROR: Error loading keymap: special://profile/keymaps/keyboard.xml, Line 16
      Error reading end tag.</pre>

Latest revision as of 10:05, 19 July 2020

Incomplete.png INCOMPLETE:
This page or section is incomplete. Please add information or correct uncertain data which is marked with a ?
Cleanup.png This page or section may require cleanup, updating, spellchecking, reformatting and/or updated images. Please improve this page if you can. The discussion page may contain suggestions.


Note: this article assumes you are using XBMC v10.0 Dharma or a later version. Earlier versions of XBMC such as v9.11 Camelot do not support key modifiers like control, shift and alt so the key mappings required for Media Center Remotes will not work.

If you have one of the many cheap MCE remote controllers then just connect it to your PC and there's a fair chance it will just work. If you have the official Microsoft MCE remote controller or a full compatible then you may need a small amount of extra effort to get it working: details below.

If you're in a hurry to get your remote working jump straight to:

However if you have the spare five minutes it will take to read this article I recommend that you take the time to do it. Once you've read this article the articles above will make more sense.


Media Center remotes are obviously designed to work with Microsoft Windows Media Center Edition (hence the "MCE" acronym) so this article concentrates on Windows. However the same remotes will usually work with Linux and possibly OSX, and much of this discussion applies to all platforms.

On Linux there is a standard method for supporting remote controllers using software called Lirc. Assuming there is a Linux driver for your remote controller you can configure Lirc to use it with XBMC. Note that XBMCLive is already configured to work with the official MS remote. Sadly, on Windows the situation is a lot more confused.

Why there is a problem (on Windows) ...

The problem with using MCE remotes is that there is no such thing as a standard MCE remote. There is the official Microsoft remote of course, and some remotes are genuinely fully compatible with the MS remote. Unfortunately the majority of MCE remote controllers, especially the cheap ones, work in different ways. There are four different ways a remote can work on Windows.

  1. The remote can send an IR code like the Microsoft remote. To use the remote an application has to link to the IR driver.
     
  2. The remote can send the Windows message WM_APPCOMMAND. This message is used to send a multimedia application messages like "Play", "Pause", "Stop" etc. To use this type of remote an application has to process the WM_APPCOMMAND messages.
     
  3. The remote can simulate multimedia key presses when you press a button. Multimedia keys were introduced with the Microsoft multimedia keyboard, which has extra keys for multimedia functions like "Play" etc. To use this type of remote an application has to process the multimedia keypresses.
     
  4. Finally the remote can simulate the standard MS Media Center keyboard shortcuts. When Microsoft introduced Media Center the specified a set of standard keyboard shortcuts to operate it. For example control-shift-P means "Play". Many cheap MCE remotes simulate these keyboard shortcuts e.g. when you press the Play button they simulate the key press control-shift-P. To use this type of remote an application has to process the Media Center key presses.

... and how to solve it

The good news is that from build 26407 onwards XBMC has support built in for remote controllers of types 2, 3 and 4. This includes the vast majority of the cheap MCE remotes, so the basic functions like "Play" etc will work without any messing around. A lot of MCE remotes include extra keys not on the official MS remote, and to get these to do anything you will need some manual configuration. All this is covered in Using an MCE remote control in Windows.

Ironically the official MS remote will not work with XBMC out of the box, or rather it will partially work: some buttons will work while others won't. This is because the MS remote uses IR codes i.e. type 1 in the list above, and XBMC does not support this. The good news is that the MS remote is easily reconfigured to work as a type 4 remote instead. This is covered in the article Using a Microsoft remote control in Windows.

A note on Linux

Remotes of type 3 and 4 will probably work on Linux out of the box, provided Linux sees the remote as a keyboard sending MCE keys. Some brief testing with a handful of cheap remotes showed they all work.

What to do next

If you have a type 1 remote such as the Microsoft remote, or one of the remotes compatible with it, see Using a Microsoft remote control in Windows.

If you have a type 2, 3 or 4 remote then it will probably work without any messing around. You might want to modify the key mappings for the myriad of extra buttons on a typical MCE clone remote. In that case see Using an MCE remote control in Windows for an introduction, or go straight to Modifying keyboard.xml if you want to jump straight in and start modifying the key mappings.