# Editing LIRC commands?

**URL:** <https://forums.plex.tv/t/editing-lirc-commands/95543>\
**Category:** Apps & Creations\
**Created:** [March 3, 2015, 2:18am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543 "2015-03-03T02:18:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 3, 2015, 2:18am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/1 "2015-03-03T02:18:09Z")

</div>

OK, a bit confused between all the XBMC, OpenELEC and Rasplex documentation.&nbsp; For the latest 0.5.1 Rasplex on a RPi2, I need help with the following:

&nbsp;

I made it easy on myself and bought an IR receiver and a MCE remote.&nbsp; 95% of the keys work out of the box, although I don't know how since I can't seem to find a LIRC.CONF file anywhere.

&nbsp;

What I need to do is edit a few of the buttons to do something else in Rasplex, since I see some other commands are available from keyboard input and I find them useful (subtitles, audio toggles, Info, etc).

&nbsp;

Where, or how do I create this override XML file?&nbsp; How do I map it to specific Openelec or PHT commands? I'm getting mixed info from the documentation sources.

&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:** [March 3, 2015, 8:08am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/2 "2015-03-03T08:08:11Z")

</div>

> OK, a bit confused between all the XBMC, OpenELEC and Rasplex documentation.&nbsp; For the latest 0.5.1 Rasplex on a RPi2, I need help with the following:  
> &nbsp;  
> I made it easy on myself and bought an IR receiver and a MCE remote.&nbsp; 95% of the keys work out of the box, although I don't know how since I can't seem to find a LIRC.CONF file anywhere.  
> &nbsp;  
> What I need to do is edit a few of the buttons to do something else in Rasplex, since I see some other commands are available from keyboard input and I find them useful (subtitles, audio toggles, Info, etc).  
> &nbsp;  
> Where, or how do I create this override XML file?&nbsp; How do I map it to specific Openelec or PHT commands? I'm getting mixed info from the documentation sources.

  
All you need to do is create a keymap.xml file that remaps existing keys or new keys to the functions you are missing. The file goes in /storage/.plexht/userdata/keymaps.  
  
have a look at this [http://danielmaclean.blogspot.co.uk/2011/08/openelec-remote-control-setup.html](http://danielmaclean.blogspot.co.uk/2011/08/openelec-remote-control-setup.html)

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 3, 2015, 9:17pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/3 "2015-03-03T21:17:16Z")

</div>

Deleted.

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 4, 2015, 4:28am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/4 "2015-03-04T04:28:20Z")

</div>

Deleted. &nbsp;(Would just jumble the solution at the end)

---

<div class="post-metadata">

**Author:** ![rcork](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rcork/32/4386_2.png) [@rcork](https://forums.plex.tv/u/rcork)\
**Post date:** [March 4, 2015, 5:22am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/5 "2015-03-04T05:22:28Z")

</div>

I struggled with GPIO IR and trying to get it working. In the end i just bought a flirc usb dongle for $22 and never looked back. Extremely easy to program with the windows or mac software and works perfectly. I programmed my harmony remote to control my Rasplex but it will work with any IR remote including MCE. I highly recommend it.

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 4, 2015, 3:02pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/6 "2015-03-04T15:02:13Z")

</div>

The FLIRC is even worse for me.&nbsp; Stuck keys, some commands not working.&nbsp; I'd prefer to get regular LIRC working if I can crack the code, but nobody seems to know what it is.

---

<div class="post-metadata">

**Author:** ![rcork](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/rcork/32/4386_2.png) [@rcork](https://forums.plex.tv/u/rcork)\
**Post date:** [March 4, 2015, 3:07pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/7 "2015-03-04T15:07:35Z")

</div>

The key to using the flirc dongle is to NOT use the xmbc profile. Switch over to full keyboard and then program per the PlexHT keyboard shortcuts [https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts](https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts)

---

<div class="post-metadata">

**Author:** ![lukeroge](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/lukeroge/32/100615_2.png) [@lukeroge](https://forums.plex.tv/u/lukeroge)\
**Post date:** [March 5, 2015, 3:48am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/8 "2015-03-05T03:48:25Z")

</div>

I've been unable to set a keymap for LIRC too. The remote works with basic functions, but none of my remote.xml commands work.

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 5, 2015, 10:54pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/9 "2015-03-05T22:54:20Z")

</div>

> All you need to do is create a keymap.xml file that remaps existing keys or new keys to the functions you are missing. The file goes in /storage/.plexht/userdata/keymaps.

This might be one of my many problems.&nbsp; It is keymap.xml or remote.xml?

I'm using an MCE Remote which is already recognized by Plex (lirc.conf is baked in) but having a problem getting any of those keys remapped to something else.&nbsp; Here is what I have so far:

&nbsp;/storage/.plexht/userdata/Lircmap.xml

```
KEY_PAUSE
       KEY_PVR
       KEY_INFO
       KEY_TV
       KEY_NUMERIC_STAR
       KEY_ANGLE
       KEY_DVD
```

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

```
PlayPause
      NextSubtitle
      CodecInfo
      AudioNextLanguage
      ContextMenu
      AspectRatio
      tab
    
  

    
      PlayPause
      NextSubtitle
      CodecInfo
      AudioNextLanguage
      ContextMenu
      AspectRatio
      tab
```

Not only does it not work, but having that Lircmap.xml file stops those particular keys from working in their original way.&nbsp; ie.&nbsp; Instead of PAUSE pausing, or even doing the new XBMC function (PlayPause), it doesn't do anything.&nbsp; Same with KEY\_INFO.&nbsp; Instead of bringing up the Movie info page, it doesn't do anything.&nbsp; I'd prefer it bring up the Codec info instead. Deleting Lircmap.xml puts it back to a normal MCE remote.

So I don't know if that means the buck stops at Lircmap.xml or if something in remote.xml is bad and it doesn't understand _those_ commands.

Help!

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 6, 2015, 1:48pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/10 "2015-03-06T13:48:49Z")

</div>

OK, I finally got it working 99%.&nbsp; I have no idea why, but after throwing stuff at the wall, it seems to do what I want now except for Aspect Ratio.&nbsp; I want to map the bottom row of buttons on my MCE remote to other commands since they don't do anything, and change two others.

The remote I have [**is this**](http://www.amazon.com/gp/product/B00GGX4XVW/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1).

KEY\_PAUSE to Play/Pause instead

KEY\_INFO to Codec Info instead of brief movie info

KEY\_PVR to subtitle selection

KEY\_TV to Audio track selection

KEY\_ANGLE to movie info (I think it does it already)

_KEY\_EPG to Aspect Ratio selection_

That bottom one still does not work.&nbsp; I can't seem to find the predetermined OpenELEC/XBMC command that activates it.

Anyway, I _only_ need a Lircmap.xml.&nbsp; Using remote.xml does nothing. I assume it's because the MCE remote it baked in.&nbsp; And by following all the available directions online, you would think my previous post was correct.&nbsp; Nope.

This is it:

```
KEY_PAUSE
       KEY_PVR
       KEY_INFO
       KEY_TV
       KEY_NUMERIC_STAR
       KEY_ANGLE
       KEY_EPG ; not working
```

If anyone can explain why that works, I'm all ears. But more importantly, I need that bottom key fixed.&nbsp; I tried select, enter and a bunch of other things but no-go.&nbsp; It's only there as a placeholder.

There is no way that I know of to map keys to new functions, but I'm happy I got this far.&nbsp; It seems I cannot use actual XBMC [functions](http://kodi.wiki/view/keymap), but am required to use a button already assigned to them.

---

<div class="post-metadata">

**Author:** ![robertsig](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@robertsig](https://forums.plex.tv/u/robertsig)\
**Post date:** [March 6, 2015, 3:51pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/11 "2015-03-06T15:51:24Z")

</div>

I finally cracked the code!&nbsp; You use a combination of XBMC functions that are already assigned, and then create new ones that are not being used by you.&nbsp; You do indeed need a remote.xml file for anything custom.&nbsp; I now have Aspect Ratio working.&nbsp; I used green & blue as keys since I don't have them on my remote.&nbsp; Here they are:

**Lircmap.xml**

```
KEY_PAUSE
       KEY_INFO
       KEY_NUMERIC_STAR  
       KEY_PVR
       KEY_TV
       KEY_ANGLE
       KEY_EPG
```

**remote.xml**

```
ContextMenu  
      AspectRatio
```

---

<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:** [March 7, 2015, 11:21am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/12 "2015-03-07T11:21:45Z")

</div>

> I finally cracked the code!&nbsp; You use a combination of XBMC functions that are already assigned, and then create new ones that are not being used by you.&nbsp; You do indeed need a remote.xml file for anything custom.&nbsp; I now have Aspect Ratio working.&nbsp; I used green & blue as keys since I don't have them on my remote.&nbsp; Here they are:  
> &nbsp;  
> **Lircmap.xml**
> 
> ```
> KEY_PAUSE
> KEY_INFO
> KEY_NUMERIC_STAR  
> KEY_PVR
> KEY_TV
> KEY_ANGLE
> KEY_EPG
> ```
> **remote.xml**  
> 
> ```
> ContextMenu  
> AspectRatio
> ```

  
Glad you managed to get this sorted, sorry, I have been away for a few days. Welcome to the mysterious world of LIRC.  
  
Can you please mark your last post as answered, it may help others find the your solution quicker.  
  
Thanks

---

<div class="post-metadata">

**Author:** ![dominiqueD](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dominiqued/32/231897_2.png) [@dominiqueD](https://forums.plex.tv/u/dominiqueD)\
**Post date:** [January 7, 2017, 7:21pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/13 "2017-01-07T19:21:20Z")

</div>

Hi guys,  
Where can I found the remote comande such as `AspectRatio`/`ContextMenu` ?  
I found some stuff \> `/usr/share/XBMC/system/Lircmap.xml`

Can we map IRcode directly to specifc keys: ([https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts](https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts))

Dominique

---

<div class="post-metadata">

**Author:** ![videotecaCNSU](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/videotecacnsu/32/17514_2.png) [@videotecaCNSU](https://forums.plex.tv/u/videotecaCNSU)\
**Post date:** [January 9, 2017, 2:34pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/14 "2017-01-09T14:34:51Z")

</div>

Sorry, I don’t quite understand your question

Yes, those are the correct commands

Not really, not exactly. You normally map them to a function and not to a specific key. For example ENTER is sometimes calls to SELECT, sometimes to OSD and sometimes to PlayPause as they are context sensitive. [Have a look here](https://raw.githubusercontent.com/xbmc/xbmc/master/system/keymaps/keyboard.xml "Have a look here") to see all commands you can pass

But there are ways to map them to actual key presses if you need to

---

<div class="post-metadata">

**Author:** ![dominiqueD](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dominiqued/32/231897_2.png) [@dominiqueD](https://forums.plex.tv/u/dominiqueD)\
**Post date:** [January 13, 2017, 2:25am UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/15 "2017-01-13T02:25:15Z")

</div>

Hi,  
I just would like to display sound menu, or subtitle menu with my Ir remote controler directly.  
I’ll have a look with your link.

---

<div class="post-metadata">

**Author:** ![videotecaCNSU](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/videotecacnsu/32/17514_2.png) [@videotecaCNSU](https://forums.plex.tv/u/videotecaCNSU)\
**Post date:** [January 13, 2017, 12:32pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/16 "2017-01-13T12:32:24Z")

</div>

Yes, map them during full screen video or videoosd on yourxml file following keyboard.xml. That way you can reuse those buttons for other functions if you are in the menus.

If you want to map that key to that function even if it’s of no use in the rest of the UI, map them to global

---

<div class="post-metadata">

**Author:** ![dominiqueD](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dominiqued/32/231897_2.png) [@dominiqueD](https://forums.plex.tv/u/dominiqueD)\
**Post date:** [January 15, 2017, 11:21pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/17 "2017-01-15T23:21:23Z")

</div>

It works !

There is a mix between Kodi/OpenElec/Rasplex so I share my results 😉

To avoid, `Remote Translator: Can't find button `, I understood that you can only map code included in TranslateRemoteString()

> <https://github.com/xbmc/xbmc/blob/7dcfacd118f41a4b2bd9c8e2368f0863ecf26dbf/xbmc/input/ButtonTranslator.cpp>

You can use default mapping, or add your owns via `/storage/.plexht/userdata/keymaps/remote.xml`

**Lircmap.xml**  
There is some simple button with perfect default value

| button | Description |
| --- | --- |
| `<power>` | To shutdown … you cannot poweron remotely |
| `<mute>` | To mute |
| `<info>` | info |
| `<menu>` | menu |
| `<back>` | Back |
| `<select>` | Select |

I spent a lot of time to find thoses one

| button | Description |
| --- | --- |
| `<volumeminus>` | Volume Down |
| `<volumeplus>` | Volume Up |
| `<language>` | Switch to next Lang |
| `<subtitle>` | Switch to next subtitle |
| `<display>` | Toggle to playback |

**keymaps/remote.xml**  
There is differents parts (global/FullscreenVideo) you need to choose the right one to avoid strange behaviour. You can remap button to different fonction.

I finally find a trick for aspectRatio:  
Add in **Lircmap.xml** a tag with your Lirc key : `<hash>KEY_P</hash>`  
And add mapping information into `/storage/.plexht/userdata/keymaps/remote.xml`

```auto
<keymap>
   <global>
     <remote>
	<pageplus>Screenshot</pageplus>
     </remote>
   </global>
<FullscreenVideo>
     <remote>
        <hash>AspectRatio</hash>
     </remote>
</FullscreenVideo>
</keymap>

```

---

<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:** [January 8, 2020, 6:53pm UTC](https://forums.plex.tv/t/editing-lirc-commands/95543/18 "2020-01-08T18:53:34Z")

</div>


