Kodi Community Forum

Full Version: Mapping remote keys
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to map a few buttons on my Harmony One remote which can't be mapped with Logitech's software directly.

What I'd like to do is, for example, re-map the Guide button to ContextMenu

Using lirc's irw command, I get the following entry when pressing Guide:

Code:
000000037ff07bdb 00 DVD mceusb

Which means that lirc interprets the button press as "DVD" button.

Then I go to lircd.conf, search for the last three letters in the long string above (000000037ff07bdbbdb), and find the following line:

Code:
DVD 0x00007bdb

Which corresponds to the DVD button.

To edit XBMC's remote.xml, I add the following, which in my view should re-map the Guide button press interpreted as DVD by lirc to XBMC's ContextMenu:

Code:
<DVD>ContextMenu</DVD>

But it doesn't work.

After looking into it further, I noticed that the Guide button is actually interpreted as "menu" button in XBMC. In other words, if I change the appropriate entry to:

Code:
<menu>ContextMenu</menu>

Then the Guide button pops up a context menu.

Now, that fixes that particular button, but there are other buttons which don't do anything, but which I'd like to map to do something, such as turn subtitles on/off or go to the next subtitle.

What am I doing wrong?
You need to map LIRC button names to XBMC's internal button names using Lircmap.xml.
While I am sure negge thought he was helping, an explanation is required. XBMC and Lirc need some understanding before attempting to tweak it.

There are 3 things that need to be understood.

Actual buttons on the remote /etc/lirc/lircd.conf

XBMC names for the lirc buttons /home/xbmc-user-name/.xbmc/userdata/lircmap.xml

XBMC commands that are tied to the XBMC names /home/xbmc-user-name/.xbmc/userdata/keymaps/remote.xml




Here is an example and traced backwards.




XBMC sends the ContextMenu command <menu>ContextMenu</menu> in /home/xbmc-user-name/.xbmc/userdata/keymaps/remote.xml

That ContextMenu command is tied to the menu name <menu>DVD_Menu</menu> in /home/xbmc-user-name/.xbmc/userdata/lircmap.xml

The menu name is tied to the actual button DVD_Menu (thats what its called for MY lirc remote yours will be different) in /etc/lirc/lircd.conf


remote.xml
Code:
<keymap>
  <global>
    <remote>
       <menu>ContextMenu</menu>


lircmap.xml
Code:
<lircmap>
    <remote device="Microsoft_Xbox360">
                <menu>DVD_Menu</menu>



lircd.conf
Code:
begin remote
  name  Microsoft_Xbox360
  bits           13
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100
  header       2682   906
  one           438   451
  zero          438   451
  pre_data_bits   24
  pre_data       0x1BFF80
  gap          107066
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000

      begin codes
          
          DVD_Menu                 0x8BDB

I have only displayed the parts of those files that are of interest. So dont try to copy paste that into your files.

Remember......lircd.conf is the file that actually contains an actual button on your remote.
DO NOT make the mistake of thinking the other two files describe button names on your remote.
The menu in remote.xml and lircmap.xml have nothing to do with the actual menu button on your remote. They are names and commands that POINT to the button on your remote.
To expand on your final question.

You cannot make up XBMC names (as you did above <DVD>ContextMenu</DVD>). You must find one you dont intend to use and repurpose it for the new intended function.

Remember...those names have nothing to do with the buttons on your remote.

For example

The name power in remote.xml can be used to turn the subtitles on and off and tied to ANY button on your remote

You can find XBMC names here https://github.com/xbmc/xbmc/blob/master....cpp#L1269
Thanks for the help. I think I now get the concept, but still can't get the changes to work.

For testing purposes, I'm trying to ge the Guide button on my remote to map to pausing playback.

This is what irw shows for Guide button press:

Code:
000000037ff07bdb 00 DVD mceusb
000000037ff07bdb 01 DVD mceusb

Here is my lircd.conf for bdb

Code:
DVD           0x00007bdb

Lircmap.xml for DVD

Code:
<lircmap>
    <remote device="mceusb">
        <menu>DVD</menu>

and complete remote.xml

Code:
<keymap>
  <global>
    <remote>
      <menu>pause</menu>
    </remote>
  </global>
</keymap>

Doesn't pause, though.
(2014-02-17, 22:45)Eklar Wrote: [ -> ]Here is my lircd.conf for bdb

<menu>DVD</menu>

Thats not the correct format for lircd.conf

If your entire file follows that format its completely incorrect.

In addition, I forgot to mention that Lircmap.xml has a capital letter L in the name
(2014-02-18, 00:57)FishOil Wrote: [ -> ]
(2014-02-17, 22:45)Eklar Wrote: [ -> ]Here is my lircd.conf for bdb

<menu>DVD</menu>

Thats not the correct format for lircd.conf

If your entire file follows that format its completely incorrect.

In addition, I forgot to mention that Lircmap.xml has a capital letter L in the name

My bad, pasted the wrong file. Here's what DVD says in lircd.conf . Previous post updated.

Code:
DVD           0x00007bdb

My Lircmap.xml starts with a capital L.
(2014-02-18, 02:37)Eklar Wrote: [ -> ]
(2014-02-18, 00:57)FishOil Wrote: [ -> ]
(2014-02-17, 22:45)Eklar Wrote: [ -> ]Here is my lircd.conf for bdb

<menu>DVD</menu>

Thats not the correct format for lircd.conf

If your entire file follows that format its completely incorrect.

In addition, I forgot to mention that Lircmap.xml has a capital letter L in the name

My bad, pasted the wrong file. Here's what DVD says in lircd.conf . Previous post updated.

Code:
DVD           0x00007bdb

My Lircmap.xml starts with a capital L.

Post the full content of lircd.conf.
Make sure you've placed Lircmap.xml directly in your userdata folder, not in keymaps/.
(2014-02-18, 08:35)negge Wrote: [ -> ]Make sure you've placed Lircmap.xml directly in your userdata folder, not in keymaps/.

Double-checked, yes, it is under
Code:
/home/username/.xbmc/userdata

Full lircd.conf below.

Code:
begin remote

  name        mceusb
  bits                 16
  flags  RC6|CONST_LENGTH
  eps                  30
  aeps                100

  header       2667   889
  one           444   444
  zero          444   444
  pre_data_bits        21
  pre_data        0x37FF0
  gap              105000
  toggle_bit           22
  rc6_mask    0x100000000


      begin codes

#seen on HP Pavilion dv3t remote  --Tim Mann, 3 Nov 2009
    Media         0x00007b7f
    PlayPause     0x00007b91


#unused by HP remote
    Blue          0x00007ba1
    Yellow          0x00007ba2
    Green          0x00007ba3
    Red          0x00007ba4
    Teletext      0x00007ba5

#ba6 - bae unused
        BA6           0x00007ba6
        BA7           0x00007ba7
        BA8           0x00007ba8
        BA9           0x00007ba9
        BAA           0x00007baa
        BAB           0x00007bab
        BAC           0x00007bac
        BAD           0x00007bad
        BAE           0x00007bae

        Radio         0x00007baf
        Print         0x00007bb1

#bb2 - bb4 unused  
        BB2           0x00007bb2
        BB3           0x00007bb3
        BB4           0x00007bb4

        Videos        0x00007bb5
        Pictures      0x00007bb6
        RecTV         0x00007bb7
        Music         0x00007bb8
        TV            0x00007bb9

#bba - bbf unused
        BBA           0x00007bba
        BBB           0x00007bbb
        BBC           0x00007bbc
        BBD           0x00007bbd
        BBE           0x00007bbe
        BBF           0x00007bbf
#bc1 - bca unused
        BC1           0x00007bc1
        BC2           0x00007bc2
        BC3           0x00007bc3
        BC4           0x00007bc4
        BC5           0x00007bc5
        BC6           0x00007bc6
        BC7           0x00007bc7
        BC8           0x00007bc8
        BC9           0x00007bc9
        BCA           0x00007bca

        Eject         0x00007bcb
        SlideShow     0x00007bcc
        Visualization 0x00007bcd

#bce - bcf unused
        BCE           0x00007bce
        BCF           0x00007bcf
#bd1 - bd7 unused
        BD1           0x00007bd1
        BD2           0x00007bd2
        BD3           0x00007bd3
        BD4           0x00007bd4
        BD5           0x00007bd5
        BD6           0x00007bd6
        BD7           0x00007bd7

        Aspect        0x00007bd8
        Guide         0x00007bd9
        LiveTV        0x00007bda
        DVD           0x00007bdb
#NoGap
        Back          0x00007bdc
        OK            0x00007bdd
        Right         0x00007bde
        Left          0x00007bdf
        Down          0x00007be0
        Up            0x00007be1
#NoGap
        Star          0x00007be2
        Hash          0x00007be3
#NoGap
        Replay        0x00007be4
        Skip          0x00007be5
        Stop          0x00007be6
        Pause         0x00007be7
        Record        0x00007be8
        Play          0x00007be9
        Rewind        0x00007bea
        Forward       0x00007beb
#NoGap
        ChanDown      0x00007bec
        ChanUp        0x00007bed
        VolDown       0x00007bee
        VolUp         0x00007bef
#NoGap
        More          0x00007bf0
        Mute          0x00007bf1
        Home          0x00007bf2
        Power         0x00007bf3
#NoGap
        Enter         0x00007bf4
        Clear         0x00007bf5
#NoGap
        Nine          0x00007bf6
        Eight         0x00007bf7
        Seven         0x00007bf8
        Six           0x00007bf9
        Five          0x00007bfa
        Four          0x00007bfb
        Three         0x00007bfc
        Two           0x00007bfd
        One           0x00007bfe
        Zero          0x00007bff
      end codes

end remote
#
# this config file was automatically generated
# using lirc-0.8.4a(default) on Mon Feb 23 23:55:04 2009
#
# contributed by
#
# brand:                       Hauppauge
# model no. of remote control:
# devices being controlled by this remote: PVR-150 Remote (MCE kit)
# SMK dongle 0609:031d
#

begin remote

  name  mceusb_hauppauge
  bits           13
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100

  header       2674   870
  one           455   427
  zero          455   427
  pre_data_bits   24
  pre_data       0x1BFF82
  gap          106288
  min_repeat      1
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000

      begin codes
          TV                       0x1BB9
          Music                    0x1BB8
          Pictures                 0x1BB6
          Videos                   0x1BB5
          Power                    0x1BF3
          Stop                     0x1BE6
          Record                   0x1BE8
          Pause                    0x1BE7
          Play                     0x1BE9
          Rewind                   0x1BEA
          Foward                   0x1BEB
          Replay                   0x1BE4
          Skip                     0x1BE5
          Back                     0x1BDC
          More                     0x1BF0
          Up                       0x1BE1
          Left                     0x1BDF
          Right                    0x1BDE
          OK                       0x1BDD
          Down                     0x1BE0
          VolUp                    0x1BEF
          VolDown                  0x1BEE
          Home                     0x1BF2
          ChanDown                 0x1BED
          ChanUp                   0x1BEC
          Mute                     0x1BF1
          RecTV                    0x1BB7
          Guide                    0x1BD9
          LiveTV                   0x1BDA
          DVD                      0x1BDB
          One                      0x1BFE
          Two                      0x1BFD
          Three                    0x1BFC
          Four                     0x1BFB
          Five                     0x1BFA
          Six                      0x1BF9
          Seven                    0x1BF8
          Eight                    0x1BF7
          Nine                     0x1BF6
          Star                     0x1BE2
          Zero                     0x1BFF
          Hash                     0x1BE3
          Clear                    0x1BF5
          Enter                    0x1BF4
      end codes

end remote


#
# this config file was automatically generated
# using lirc-0.8.4a(default) on Tue Mar 10 19:27:09 2009
#
# contributed by
#
# brand:  SIIG Vista MCE remote
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote

  name  vista_mce
  bits           16
  flags RC6
  eps            30
  aeps          100

  header       2654   889
  one           427   427
  zero          427   427
  pre_data_bits   21
  pre_data       0x37FF0
  gap          69850
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000

      begin codes
          Power                    0xEBF3
          Pictures                 0x6BB6
          Radio                    0xEBAF
          Videos                   0x6BB5
          Music                    0xEBB8
          Rec                      0x6BE8
          Pause                    0xEBE7
          Stop                     0x6BE6
          Skipback                 0xEBE4
          Play                     0x6BE9
          Skipfwd                  0xEBE5
          Rwd                      0x6BEA
          Fwd                      0xEBEB
          Start                    0x6BF2
          Back                     0xEBDC
          More                     0x6BF0
          Volup                    0xEBEF
          Voldown                  0x6BEE
          Chup                     0xEBED
          Chdown                   0x6BEC
          Up                       0xEBE1
          Down                     0x6BE0
          Left                     0xEBDF
          Right                    0x6BDE
          Mute                     0xEBF1
          Rectv                    0x6BB7
          Guide                    0xEBD9
          Livetv                   0x6BDA
          Dvdmenu                  0xEBDB
          1                        0x6BFE
          2                        0xEBFD
          3                        0x6BFC
          4                        0xEBFB
          5                        0x6BFA
          6                        0xEBF9
          7                        0x6BF8
          8                        0xEBF7
          9                        0x6BF6
          *                        0xEBE2
          0                        0x6BFF
          #                        0xEBE3
          Clear                    0x6BF5
          Enter                    0xEBF4
      end codes

end remote
I can look more in detail later but off hand I think it needs a capital P in Pause

in remote.xml

<menu>Pause</menu>
(2014-02-19, 01:54)FishOil Wrote: [ -> ]I can look more in detail later but off hand I think it needs a capital P in Pause

in remote.xml

<menu>Pause</menu>

I actually have tried both capitalized and non-capitalized, neither work.

I bet the issue is something simple/stupid like that, though Tongue So many layers of files and so many small things that can go wrong in the chain.
Lircmap <pause>DVD</pause>
Remote.xml <pause>Pause</pause>

It wont work if the function or name is duplicated in the relevant section. It must be unique


Edit
Just to clarify.

You can make every button pause. as in
Lircmap.xml (if these were th actual name of your buttons)
<pause>DVD</pause>
<pause>Guide</pause>
<pause>Play</pause>
<pause>Stop</pause>
<pause>Rewind</pause>

But you cant
Remote.xml
<keymap>
<global>
<remote>
<play>Pause</play>
<pause>Pause</pause>
<menu>Pause</menu>
Edit again, I actually just tried the above and it still works


So if your Remote.xml is setup correctly the only file you need to modify is Lircmap.xml when you want to change a button function

3rd Edit
What does NOT work is Lircmap.xml
<pause>DVD</pause>
<stop>DVD</stop>
<play>DVD</play>

The actual button NAME must be unique in Lircmap.xml
Ok, So here is the bottom line. There are two acceptable ways of doing this.

In Lircmap.xml you can change <pause>WHATEVER IS THERE NOW</pause> to <pause>DVD</pause>
But "DVD" can only occur one time in that file under the mceusb section. Swap it with whatever your changing or remove just the three letters (DVD) between the brackets. If its <menu>DVD</menu> then make it <menu></menu>

Or

In Remote.xml add whatever xbmc name was given to your DVD (Lircmap.xml XBMC Name) button to the fullscreenvideo or global section.
From your previous post is would seem that its menu. As in <menu>DVD</menu>

So, in Remote.xml

<FullscreenVideo>
<remote>
<menu>Pause</menu>


Personally I prefer only changing Lircmap.xml if your remote.xml is configured correctly.
That way I dont have to hunt down the different instances.

If you still cant get it going, Post all three files to pastebin and I can help you set it up.
(2014-02-19, 07:00)FishOil Wrote: [ -> ]Personally I prefer only changing Lircmap.xml if your remote.xml is configured correctly.
That way I dont have to hunt down the different instances.

I agree, I try to modify the actual keymap as little as possible.
Pages: 1 2