# CEC remote keys mapping

**URL:** <https://forums.plex.tv/t/cec-remote-keys-mapping/53823>\
**Category:** Apps & Creations\
**Created:** [January 12, 2014, 2:58pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823 "2014-01-12T14:58:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![grostim](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/grostim/32/100074_2.png) [@grostim](https://forums.plex.tv/u/grostim)\
**Post date:** [January 12, 2014, 2:58pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/1 "2014-01-12T14:58:56Z")

</div>

Hi,

&nbsp;

I am testing Rasplex for a few days now, and first I would like to congratulate you guys for the great job done.

&nbsp;

I am a interacting with Rasplex through the remote of my panasonic 42PX71 , (trough CEC

I am a little bit confused by the keys and their functions.

&nbsp;

I have found out that the folloqing keys or active through CEC:

- up , down, left, right,&nbsp;

- OK,&nbsp;

- Return

- Option

&nbsp;

It seems also that the red, green, blue and yellow keys are active, but I have not been able to understand what they are doing exactly .

Is it documented ? Are there other active keys ?

---

<div class="post-metadata">

**Author:** ![cleverdevil](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cleverdevil/32/5001_2.png) [@cleverdevil](https://forums.plex.tv/u/cleverdevil)\
**Post date:** [January 13, 2014, 11:22pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/2 "2014-01-13T23:22:05Z")

</div>

Its not really well documented anywhere, no. Just takes some experimentation, and, better yet, configuration and tweaking.

I have a Panasonic plasma TV, and my Rasplex pi is connected via HDMI through a Marantz receiver. I have configured a `remote.xml` file that maps some unused or lesser used functionality to useful settings, and reprogrammed my Logitech Harmony remote to make everything work really well. Here is my remote.xml:

```
Play
      FastForward
      Rewind
      Stop
      Left
      Right
      Up
      Down
      Select
```

My only issue is that if I switch my receiver from the Rasplex to my DirecTV or Apple TV and then back a little while later, Rasplex seems to lose its CEC handshake with the TV, and I have to either reboot the pi, or simply restart Plex Home Theater. I have configured a little single-tap shortcut in iSSH on my iPhone and iPad to `killall plexhometheater` for this purpose.

---

<div class="post-metadata">

**Author:** ![liiight](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/liiight/32/3689_2.png) [@liiight](https://forums.plex.tv/u/liiight)\
**Post date:** [January 14, 2014, 12:08pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/3 "2014-01-14T12:08:31Z")

</div>

> I have configured a `remote.xml` file that maps some unused or lesser used functionality to useful settings

Where do you place that file? I'd be interested in something like that as well.

---

<div class="post-metadata">

**Author:** ![grostim](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/grostim/32/100074_2.png) [@grostim](https://forums.plex.tv/u/grostim)\
**Post date:** [January 14, 2014, 1:58pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/4 "2014-01-14T13:58:22Z")

</div>

> Its not really well documented anywhere, no. Just takes some experimentation, and, better yet, configuration and tweaking.
> 
> I have a Panasonic plasma TV, and my Rasplex pi is connected via HDMI through a Marantz receiver. I have configured a `remote.xml` file that maps some unused or lesser used functionality to useful settings, and reprogrammed my Logitech Harmony remote to make everything work really well. Here is my remote.xml:
> 
> ```
> Play
> FastForward
> Rewind
> Stop
> Left
> Right
> Up
> DownSelect
> ```
> 
> My only issue is that if I switch my receiver from the Rasplex to my DirecTV or Apple TV and then back a little while later, Rasplex seems to lose its CEC handshake with the TV, and I have to either reboot the pi, or simply restart Plex Home Theater. I have configured a little single-tap shortcut in iSSH on my iPhone and iPad to `killall plexhometheater` for this purpose.

Great !

Where do you install this file ?

Is there a list of the available key from the panasonic ? and the corresponding list of possible actions on PHT ?

EDIT: Ok: interesting informations here:&nbsp;[http://wiki.xbmc.org/index.php?title=Keymap](http://wiki.xbmc.org/index.php?title=Keymap)

---

<div class="post-metadata">

**Author:** ![cleverdevil](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cleverdevil/32/5001_2.png) [@cleverdevil](https://forums.plex.tv/u/cleverdevil)\
**Post date:** [January 14, 2014, 6:28pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/5 "2014-01-14T18:28:22Z")

</div>

> Great !
> 
> Where do you install this file ?
> 
> Is there a list of the available key from the panasonic ? and the corresponding list of possible actions on PHT ?
> 
> EDIT: Ok: interesting informations here:&nbsp;[http://wiki.xbmc.org/index.php?title=Keymap](http://wiki.xbmc.org/index.php?title=Keymap)

I installed it at&nbsp;/storage/.plexht/userdata/keymaps and I think I also installed it at&nbsp;/storage/.plexht/userdata because I wasn't positive which place. Then, I reboot the pi.

I don't know if there is a list of available keys from panasonic. There are some tools out there for exploring and logging CEC commands, but I couldn't get any of them working reliably on the pi, so mostly did trial and error by pushing buttons on the remote to see if they did \*anything\* at all. If they did, but not what I wanted, I just remapped them in the XML file.&nbsp;

---

<div class="post-metadata">

**Author:** ![liiight](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/liiight/32/3689_2.png) [@liiight](https://forums.plex.tv/u/liiight)\
**Post date:** [January 15, 2014, 8:48am UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/6 "2014-01-15T08:48:20Z")

</div>

I'll give this a try. This sounds like a good way to program the remote to reboot the RPI if needed.

The list of commands you programmed (Play,Stop, etc.), where is this configured? Is this a fixed list?&nbsp;

Thanks!

---

<div class="post-metadata">

**Author:** ![grostim](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/grostim/32/100074_2.png) [@grostim](https://forums.plex.tv/u/grostim)\
**Post date:** [January 15, 2014, 1:20pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/7 "2014-01-15T13:20:02Z")

</div>

> I installed it at&nbsp;/storage/.plexht/userdata/keymaps and I think I also installed it at&nbsp;/storage/.plexht/userdata because I wasn't positive which place. Then, I reboot the pi.
> 
> I don't know if there is a list of available keys from panasonic. There are some tools out there for exploring and logging CEC commands, but I couldn't get any of them working reliably on the pi, so mostly did trial and error by pushing buttons on the remote to see if they did \*anything\* at all. If they did, but not what I wanted, I just remapped them in the XML file.&nbsp;

/storage/.plexht/userdata/keymaps was the right pasth form me.

I used your remote.xml file, and added a command for the "exit" button to go back to home screen.&nbsp;

Thanks to the "cec-client" program (to be executed throug ssh) i have been able to monitor the CEC command received by the Pi.&nbsp;

Conclusion:

The only buttons that goes through CEC are :

- arrows

- select

- exit (seen as "clear" through CEC)

- option

- the 4 colored buttons.

All others buttons commands are not reaching the Pi.

---

<div class="post-metadata">

**Author:** ![grostim](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/grostim/32/100074_2.png) [@grostim](https://forums.plex.tv/u/grostim)\
**Post date:** [January 15, 2014, 1:21pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/8 "2014-01-15T13:21:37Z")

</div>

> The list of commands you programmed (Play,Stop, etc.), where is this configured? Is this a fixed list?&nbsp;

Everything is here:

[http://wiki.xbmc.org/index.php?title=Action\_IDs](http://wiki.xbmc.org/index.php?title=Action_IDs)

---

<div class="post-metadata">

**Author:** ![liiight](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/liiight/32/3689_2.png) [@liiight](https://forums.plex.tv/u/liiight)\
**Post date:** [January 15, 2014, 2:55pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/9 "2014-01-15T14:55:06Z")

</div>

Thanks, i'll try it tonight!

---

<div class="post-metadata">

**Author:** ![liiight](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/liiight/32/3689_2.png) [@liiight](https://forums.plex.tv/u/liiight)\
**Post date:** [January 16, 2014, 2:19pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/10 "2014-01-16T14:19:47Z")

</div>

I tried this lat night and it didn't seem to work.

This is the contents of the remote.xml:

&nbsp; 

&nbsp; &nbsp; 

&nbsp; &nbsp; &nbsp; Info

&nbsp; &nbsp; &nbsp; OSD

&nbsp; &nbsp; &nbsp; Rewind

&nbsp; &nbsp; &nbsp; ShowSubtitles

&nbsp; &nbsp; &nbsp; Left

&nbsp; &nbsp; &nbsp; Right

&nbsp; &nbsp; &nbsp; Up

&nbsp; &nbsp; &nbsp; Down

&nbsp; &nbsp; &nbsp; Select

&nbsp; &nbsp; 

&nbsp; 

&nbsp;

Clicking the colored buttons during playback had 0 effect. I place hte file under&nbsp;/storage/.plexht/userdata/keymaps and restarted the device.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![martinpreiss](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/martinpreiss/32/83084_2.png) [@martinpreiss](https://forums.plex.tv/u/martinpreiss)\
**Post date:** [July 5, 2014, 9:35pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/11 "2014-07-05T21:35:53Z")

</div>

I dealt with is as well. In Debug you'll find what is loaded for your system

```
cat /storage/.plexht/temp/plexhometheater.log |grep "Loading special"
```

usually it is remote.xml now copy this to userdata

```
cp /usr/share/xbmc/system/keymaps/remote.xml /storage/.plexht/userdata/keymaps/
```

check when pressing keys what is send thru Cec

```
tail -f /storage/.plexht/temp/plexhometheater.log |grep CecLogMessage
```

and check as well other debug output "OnKey"

```
tail -f /storage/.plexht/temp/plexhometheater.log |grep "OnKey"
```

then according on your findings edit the remote.xml file

```
vi /storage/.plexht/userdata/keymaps/remote.xml
```

Mine for Panasonic Viera TV remote looks like this: (to be able to use play, pause etc in lower part of the remote (part for VieraConnect player), you need to code the remote. In my case hold the lower power button, press 73 and STOP and release lower power button.)

```
Play
      Pause
      Stop
      FastForward
      Rewind
      Left
      Right
      Up
      Down
      Select
      FullScreen 
      PageUp
      PageDown
      Back
      PreviousMenu
      ContextMenu
      Info
      SkipNext
      SkipPrevious
      FullScreen
      PreviousMenu
      Screenshot
      VolumeUp
      VolumeDown
      Mute
      XBMC.ShutDown()
      reloadkeymaps
      XBMC.ActivateWindow(MySharedContent,plexserver://shared,return)
      XBMC.ActivateWindow(VideoFiles,plexserver://2b1a499bb9906fc5ab5304f4345b90ae365264c0/library/sections/3/all,return)
      XBMC.ActivateWindow(VideoFiles,plexserver://2b1a499bb9906fc5ab5304f4345b90ae365264c0/library/sections/7/all,return)
      Number0
      Number1
      JumpSMS2
      JumpSMS3
      JumpSMS4
      JumpSMS5
      JumpSMS6
      JumpSMS7
      JumpSMS8
      JumpSMS9
    
  
  
    
      XBMC.ActivateWindow(SystemInfo)
      
    
  
  
    
      Number0
      Number1
      Number2
      Number3
      Number4
      Number5
      Number6
      Number7
      Number8
      Number9
      StepBack
      StepForward
      BigStepForward
      BigStepBack
      Stop
      OSD
      OSD
      OSD
      NextSubtitle
      AudioNextLanguage
      Info
      SubtitleDelayPlus
      CodecInfo
      Info
      
	ChapterOrBigStepForward
	ChapterOrBigStepBack
      Playlist
      AudioNextLanguage
      SubtitleDelayPlus
      SubtitleDelayMinus
    
  
....etc
```

---

<div class="post-metadata">

**Author:** ![hstamas](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hstamas/32/2006_2.png) [@hstamas](https://forums.plex.tv/u/hstamas)\
**Post date:** [July 15, 2014, 1:51pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/12 "2014-07-15T13:51:55Z")

</div>

> I tried this lat night and it didn't seem to work.
> 
> This is the contents of the remote.xml:
> 
> &nbsp; 
> 
> &nbsp; &nbsp; 
> 
> &nbsp; &nbsp; &nbsp; Info
> 
> &nbsp; &nbsp; &nbsp; OSD
> 
> &nbsp; &nbsp; &nbsp; Rewind
> 
> &nbsp; &nbsp; &nbsp; ShowSubtitles
> 
> &nbsp; &nbsp; &nbsp; Left
> 
> &nbsp; &nbsp; &nbsp; Right
> 
> &nbsp; &nbsp; &nbsp; Up
> 
> &nbsp; &nbsp; &nbsp; Down
> 
> &nbsp; &nbsp; &nbsp; Select
> 
> &nbsp; &nbsp; 
> 
> &nbsp; 
> 
> &nbsp;
> 
> Clicking the colored buttons during playback had 0 effect. I place hte file under&nbsp;/storage/.plexht/userdata/keymaps and restarted the device.
> 
> Any suggestions?

Has anyone succefully remapped the color buttons on their TV remote to do what liight was trying to do? I am trying to do the exact same thing and am getting nowhere. Does Rasplex support mapping of the more exotic keystoke features like OSD or marking as watched or are we only able to map things like play or fast forward etc.?

---

<div class="post-metadata">

**Author:** ![hstamas](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hstamas/32/2006_2.png) [@hstamas](https://forums.plex.tv/u/hstamas)\
**Post date:** [July 17, 2014, 1:55pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/13 "2014-07-17T13:55:44Z")

</div>

I managed to figure out how to run a SSH shell and use the "trail" feature to show my button presses and discovered that the color buttons on my particular TV (2013 Vizio) are not registered as button presses by the Pi. Liiight, I am posting this for you in particular just in case you are still trying to figure out why your remote.xml file doesnt seem to do anything.

---

<div class="post-metadata">

**Author:** ![liiight](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/liiight/32/3689_2.png) [@liiight](https://forums.plex.tv/u/liiight)\
**Post date:** [July 20, 2014, 7:39am UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/14 "2014-07-20T07:39:33Z")

</div>

thanks for the information, ill look into this "trail" feature as well!

---

<div class="post-metadata">

**Author:** ![Stuarty](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Stuarty](https://forums.plex.tv/u/Stuarty)\
**Post date:** [October 8, 2014, 5:01pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/15 "2014-10-08T17:01:35Z")

</div>

> I dealt with is as well. In Debug you'll find what is loaded for your system
> 
> ```
> cat /storage/.plexht/temp/plexhometheater.log |grep "Loading special"
> ```
> 
> usually it is remote.xml now copy this to userdata
> 
> ```
> cp /usr/share/xbmc/system/keymaps/remote.xml /storage/.plexht/userdata/keymaps/
> ```
> 
> check when pressing keys what is send thru Cec
> 
> ```
> tail -f /storage/.plexht/temp/plexhometheater.log |grep CecLogMessage
> ```
> 
> and check as well other debug output "OnKey"
> 
> ```
> tail -f /storage/.plexht/temp/plexhometheater.log |grep "OnKey"
> ```
> 
> then according on your findings edit the remote.xml file
> 
> ```
> vi /storage/.plexht/userdata/keymaps/remote.xml
> ```
> 
> Mine for Panasonic Viera TV remote looks like this: (to be able to use play, pause etc in lower part of the remote (part for VieraConnect player), you need to code the remote. In my case hold the lower power button, press 73 and STOP and release lower power button.)

Hello Issic, any chance you could post your full remote.xml and tell me where you found the long urls for the plex server libraries? I have the same TV and have had only some success remapping remote buttons.&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [October 8, 2014, 11:50pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/16 "2014-10-08T23:50:41Z")

</div>

**1) Create Remote.xml**

- Create a remote.xml if you don't have one. As grostin pointed out, actions can be found at [http://wiki.xbmc.org/index.php?title=Action\_IDs](http://wiki.xbmc.org/index.php?title=Action_IDs)
- Here's a link for more information on creating the file (Note: called keyboard.xml in the links, but same thing) [http://wiki.xbmc.org/?title=HOW-TO:Modify\_keyboard.xml](http://wiki.xbmc.org/?title=HOW-TO:Modify_keyboard.xml)
- You can just use a text editor, copy and paste the text from those links or from this thread and then save as remote.xml on your computer

**2) Copy Remote.xml to Pi**

- The remote.xml needs to go into&nbsp; /storage/.plexht/userdata/keymaps/
- Quick way on a Mac (sorry, someone else can chime in for other OS) is through terminal:

```
scp /location/remote.xml root@rasplex.local:/storage/.plexht/userdata/keymaps/
```

- Where _location_ is the correct location of the file.
- Depending on your network, you might need to change rasplex.local to an IP address, you can get your IP address by doing these steps on the Pi:
  - Go left and choose System Settings
  - Select Connections - IP address should be listed.

- If this is the first time, you'll be asked to accept the RSA key, type "yes" and hit enter/return.
- You'll be asked for password, if this is your first time and everything is default, the password is: rasplex

**3) Reboot Pi**

- Either unplug power, or use ssh and reboot.

**Issues**

- If nothing works, check to make sure that remote.xml is in the correct place and isn't corrupted. Somehow copying once for me the file corrupted, so I had to redo

**Extra Gravy AKA Get Your Remote REALLY Working**

If anyone having trouble with the Pi recognizing your extra remote buttons, such as Fastforward/Rewind etc, you might want to try adding this line to your config.txt

```
hdmi_ignore_cec_init=1
```

Place it at the end of the config text file and do a power cycle of BOTH the Pi and your TV (just to make sure). You might need to redo your HDMI link, on my Panasonic I can hit Viera Tools, Viera Link, and confirm Player. I have a Panasonic 55" 3D TC something or other model, so your mileage might vary on this one.

Here's what I do with my keymap currently:

&nbsp;   
&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ContextMenu  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Delete  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AudioNextLanguage  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NextSubtitle  
&nbsp;&nbsp;   
&nbsp;

- Yellow - brings up the context menu on a file so I can delete.
- Blue - was an attempt to map straight to a delete action, which is taken from XBMC list, but doesn't actually work, boooo..
- Red - I can cycle through audio languages while playing
- Green - I can cycle through subtitles while playing

You can pretty much set any of your buttons on your remote, other than hardcoded ones such as Netflix or whatever, to do various functions. I used to have it set up on a Mac so I could hit 1, 2, or 3 to change the view to recently added, etc.. but that was on the Mac version, and I haven't looked into it yet with the Pi.

---

<div class="post-metadata">

**Author:** ![jollster101](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jollster101](https://forums.plex.tv/u/jollster101)\
**Post date:** [November 6, 2014, 6:38pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/17 "2014-11-06T18:38:40Z")

</div>

That's good info vengeancegoon.

One question which I hope someone knows the answer to, I have used winscp to search rasplex and found that there is a remote.xml file in the following location:

/usr/share/xbmc/system/keymaps

Does putting a remote.xml in to&nbsp;/storage/.plexht/userdata/keymaps/&nbsp;override what is in /usr/share/xbmc/system/keymaps?

Or does they work together to provide extended functionality???

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [November 6, 2014, 9:42pm UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/18 "2014-11-06T21:42:13Z")

</div>

> That's good info vengeancegoon.  
> &nbsp;  
> One question which I hope someone knows the answer to, I have used winscp to search rasplex and found that there is a remote.xml file in the following location:  
> &nbsp;  
> /usr/share/xbmc/system/keymaps  
> &nbsp;  
> Does putting a remote.xml in to&nbsp;/storage/.plexht/userdata/keymaps/&nbsp;override what is in /usr/share/xbmc/system/keymaps?  
> &nbsp;  
> Or does they work together to provide extended functionality???

  
Yes, they override.  
  
Regards

---

<div class="post-metadata">

**Author:** ![jollster101](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jollster101](https://forums.plex.tv/u/jollster101)\
**Post date:** [November 7, 2014, 9:58am UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/19 "2014-11-07T09:58:17Z")

</div>

> Yes, they override.  
>   
> Regards

Cool, ta Ned.

---

<div class="post-metadata">

**Author:** ![mattail](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mattail](https://forums.plex.tv/u/mattail)\
**Post date:** [April 7, 2015, 8:44am UTC](https://forums.plex.tv/t/cec-remote-keys-mapping/53823/20 "2015-04-07T08:44:58Z")

</div>

This is an old thread but do you know if there is a command for launching and closing plex home theater. Some kind on toggle on/off?

The idea is that when pressing red button on tv-remote (panasonic) this will launch plex.

[Next page](https://forums.plex.tv/t/cec-remote-keys-mapping/53823.md?page=2)
