Difference between revisions of "Remote Control"

From MythTV Official Wiki
Jump to: navigation, search
(Rewriting for new user manual)
(Add info about customizing the keyboard emulation remote)
Line 1: Line 1:
 
{{User Manual TOC}}
 
{{User Manual TOC}}
  
 +
==Introduction==
 
After installing the MythTV software, you need to configure your remote control. Initially, only the keyboard can be used for controlling the frontend. This is fine for testing, but you probably want to use a remote control with your setup.
 
After installing the MythTV software, you need to configure your remote control. Initially, only the keyboard can be used for controlling the frontend. This is fine for testing, but you probably want to use a remote control with your setup.
  
 
Options for remote controls are covered in the section [[User_Manual:Setting_Up#Remote controls|Remote controls]]. here we will describe how to configure each type of remote.
 
Options for remote controls are covered in the section [[User_Manual:Setting_Up#Remote controls|Remote controls]]. here we will describe how to configure each type of remote.
  
 +
===Keyboard Emulation===
 +
====Check if your remote emulates a keyboard====
 +
#Open a command window and pressing some keys on the remote (try number keys if possible). See if they echo on the command window.
 +
#Run '''lsusb -v|less'''. Search the results for "Keyboard" (type /Keyboard). See if that is reported under the heading of your remote (it will be reported for your normal keyboard if that is a USB device).
 +
#Install and run '''ir-keytable'''. If that reports your remote then it is an ''ir-keytable'' remote (see below). If not it is likely a keyboard emulation remote.
 +
====Modify media keys====
 +
Once you are sure that this is a keyboard emulation device, you can configure it. You probably do not want to change any keys that it generates, because those will then affect your real keyboard as well. For example if the remote Fast Forward button generates an F and you change it to generate a '>', then your keyboard F will also generate a greater than sign, not good.
  
 +
There may be keys on the remote that create unwanted actions, such as "Play", "Stop", "Next", "Prev". These may attempt to launch the internal music player. Run xev. This opens a window. Click in the window and press a remote key, while watching the output in the command window. It should show a keypress event and inside there show a keycode. It instead it shows a lose focus event, that button is being swallowed up by the Linux system. To fix this run dconf editor. Navigate to org.gnome.settings-daemon.plugins.media-keys. Set ''next'', ''pause'', ''play'',''prev'', ''stop'' to empty character strings. These changes will only affect that logged in user. Now running xev will be able to show the keycodes for those keys. At the same time you may identify other keys there that you want to use. Changes you make here affect all keyboards when logged into that user.
 +
 +
Another way to disable these media buttons is to run these commands from the command line:
 +
<pre>
 +
gsettings set org.gnome.settings-daemon.plugins.media-keys next ''
 +
gsettings set org.gnome.settings-daemon.plugins.media-keys pause ''
 +
gsettings set org.gnome.settings-daemon.plugins.media-keys play ''
 +
gsettings set org.gnome.settings-daemon.plugins.media-keys previous ''
 +
gsettings set org.gnome.settings-daemon.plugins.media-keys stop ''
 +
</pre>
 +
Now that you have disabled the media buttons, run xev and find the keycode for each button. Create a file that maps these to the desired keystrokes, for example:
 +
<pre>
 +
keycode 171 = period greater period greater
 +
keycode 172 = p P p P
 +
keycode 173 = comma less comma less
 +
keycode 174 = Escape NoSymbol Escape
 +
</pre>
 +
The man page for xmodmap explains the syntax. Place this file in <code> /home/{user}/.Xmodmap</code> on Ubuntu systems or <code>/home/{user}/.xmodmaprc</code> in Fedora systems, or place it elsewhere and make sure to run <code>xmodmap {filename}</code> either at login or before you start the frontend.
 +
 +
===ir-keytable===
 +
 +
===Linux Infrared Control (LIRC)===
 +
 +
=== Wi-Fi Remote ===
  
  
 
[[Category:Remote Control]]
 
[[Category:Remote Control]]

Revision as of 19:42, 3 October 2015


Introduction

After installing the MythTV software, you need to configure your remote control. Initially, only the keyboard can be used for controlling the frontend. This is fine for testing, but you probably want to use a remote control with your setup.

Options for remote controls are covered in the section Remote controls. here we will describe how to configure each type of remote.

Keyboard Emulation

Check if your remote emulates a keyboard

  1. Open a command window and pressing some keys on the remote (try number keys if possible). See if they echo on the command window.
  2. Run lsusb -v|less. Search the results for "Keyboard" (type /Keyboard). See if that is reported under the heading of your remote (it will be reported for your normal keyboard if that is a USB device).
  3. Install and run ir-keytable. If that reports your remote then it is an ir-keytable remote (see below). If not it is likely a keyboard emulation remote.

Modify media keys

Once you are sure that this is a keyboard emulation device, you can configure it. You probably do not want to change any keys that it generates, because those will then affect your real keyboard as well. For example if the remote Fast Forward button generates an F and you change it to generate a '>', then your keyboard F will also generate a greater than sign, not good.

There may be keys on the remote that create unwanted actions, such as "Play", "Stop", "Next", "Prev". These may attempt to launch the internal music player. Run xev. This opens a window. Click in the window and press a remote key, while watching the output in the command window. It should show a keypress event and inside there show a keycode. It instead it shows a lose focus event, that button is being swallowed up by the Linux system. To fix this run dconf editor. Navigate to org.gnome.settings-daemon.plugins.media-keys. Set next, pause, play,prev, stop to empty character strings. These changes will only affect that logged in user. Now running xev will be able to show the keycodes for those keys. At the same time you may identify other keys there that you want to use. Changes you make here affect all keyboards when logged into that user.

Another way to disable these media buttons is to run these commands from the command line:

gsettings set org.gnome.settings-daemon.plugins.media-keys next ''
gsettings set org.gnome.settings-daemon.plugins.media-keys pause ''
gsettings set org.gnome.settings-daemon.plugins.media-keys play ''
gsettings set org.gnome.settings-daemon.plugins.media-keys previous ''
gsettings set org.gnome.settings-daemon.plugins.media-keys stop ''

Now that you have disabled the media buttons, run xev and find the keycode for each button. Create a file that maps these to the desired keystrokes, for example:

keycode 171 = period greater period greater
keycode 172 = p P p P
keycode 173 = comma less comma less
keycode 174 = Escape NoSymbol Escape

The man page for xmodmap explains the syntax. Place this file in /home/{user}/.Xmodmap on Ubuntu systems or /home/{user}/.xmodmaprc in Fedora systems, or place it elsewhere and make sure to run xmodmap {filename} either at login or before you start the frontend.

ir-keytable

Linux Infrared Control (LIRC)

Wi-Fi Remote