CEC Remote Buttons - How do I find out which button has been pressed?

Is this a standard for just rasplex, the function you describe for esc and back?
As PHT does stop playback with esc and back.
Sent from my HTC One_M8 using Tapatalk


Can you control PHT with CEC. Different remotes for different TVs have different mappings, hence the purpose of this topic.

Can you control PHT with CEC. Different remotes for different TVs have different mappings, hence the purpose of this topic.


Ok, so using CEC it seems rasplex does not use esc or back as expected. What is the recommended setting in rasplex to have it interact with esc and back like PHT does (stopping playback)?

Sent from my HTC One_M8 using Tapatalk 

See: https://forums.plex.tv/topic/150209-cec-remote-buttons-how-do-i-find-out-which-button-has-been-pressed/?p=881090

Ok, so using CEC it seems rasplex does not use esc or back as expected. What is the recommended setting in rasplex to have it interact with esc and back like PHT does (stopping playback)?
Sent from my HTC One_M8 using Tapatalk


No idea, when you find out please post back.

Regards

No idea, when you find out please post back.
Regards

"Obviously", there won't be anything to post back as you have stated that rasplex does not use esc or back to stop playback.



Sent from my HTC One_M8 using Tapatalk

See: https://forums.plex.tv/topic/150209-cec-remote-buttons-how-do-i-find-out-which-button-has-been-pressed/?p=881090 

Is this a standard for just rasplex, the function you describe for esc and back?
As PHT does stop playback with esc and back.
Sent from my HTC One_M8 using Tapatalk

  

Ok, so using CEC it seems rasplex does not use esc or back as expected. What is the recommended setting in rasplex to have it interact with esc and back like PHT does (stopping playback)?
Sent from my HTC One_M8 using Tapatalk

  

"Obviously", there won't be anything to post back as you have stated that rasplex does not use esc or back to stop playback.
Sent from my HTC One_M8 using Tapatalk


I have not mentioned Esc or Back at all, a number of mentions of Exit and Return have been made in relation to CEC commands (which is what this topic is concerned with). I have never seen a CEC enabled TV remote with buttons for Esc or Back, Return and Exit yes.

As to not confuse this issue for anyone else.....

My assertion that PHT does stop playback with the HDMI-CEC Exit button is incorrect.

After looking at my NUC (with Openelec+PHT) again, the machine I was comparing RASPLEX to, I realized I had a mixture of IR commands and HDMI-CEC working together.  What I thought was HDMI-CEC exit stopping playback using Openelec+PHT was actually the IR remote button doing the work.

I will note this in the previous comments as well so futures reader of this are not confused

As to not confuse this issue for anyone else.....

My assertion that PHT does stop playback with the HDMI-CEC Exit button is incorrect.

After looking at my NUC (with Openelec+PHT) again, the machine I was comparing RASPLEX to, I realized I had a mixture of IR commands and HDMI-CEC working together.  What I thought was HDMI-CEC exit stopping playback using Openelec+PHT was actually the IR remote button doing the work.

I will note this in the previous comments as well so futures reader of this are not confused

Thanks for posting back and clarifying for other users.

Regards

You can make it stop using a keymap.

Turn on debug and the tail the log file. Press exit/return etc and see what key is pressed.

Then use the kodi keymap wiki page to help make those keys stop playback when in full screen video.

If you're still having problems next time I'm at my pc I'll post an example. :)

EDIT: (but I've just tried it and it doesn't work. Which is strange, because my other maps work)


    
            Stop
    

You can make it stop using a keymap.
Turn on debug and the tail the log file. Press exit/return etc and see what key is pressed.
Then use the kodi keymap wiki page to help make those keys stop playback when in full screen video.
If you're still having problems next time I'm at my pc I'll post an example. :)


EDIT: (but I've just tried it and it doesn't work. Which is strange, because my other maps work)

                Stop    
You have just repeated what was in my original post, but you haven't provided a working solution to the issue (in fact you've agreed that what you tried to do didn't work).

Making it stop playing wasn't the issue, apparently it was mimicking the Esc key on a keyboard, I.e. apparently it stops playback and exits to Home screen.

You have just repeated what was in my original post, but you haven't provided a working solution to the issue (in fact you've agreed that what you tried to do didn't work).


And what you have just done is write a small description of my post? Ha.

I know it didn't work, as you have stated, hence why I put that it didn't in the edit. I don't understand why you have to once again state that it doesn't work haha.

I seem to have obviously missed something in the conversation, I thought it was just getting the content to stop playing. Which apparently I don't know the answer to anyway so...


The change probably needs to happen in the actual code of rasplex. It appears to have more attributes from Kodi than PHT does (certain extra menus etc). It is following how kodi would deal with pressing the exit/escape key.

If you already knew this, or I'm completely wrong then just forget I even commented in the first place. ;)

Does this solve the issue in 0.5.1 where EXIT does not stop the playing of the media file (audio continues)?

After researching this further, on a Mac/PC in Plex HT 1.3.6, the 'Esc' key and the 'X' key perform the same function, it stops playback and returns to the pre-play screen, pressing 'Esc' does not stop playback and return you to the Home screen.

 

In Rasplex, pressing 'Stop' stops playback and returns you to the pre-play screen.

 

Now realising that some TV remotes don’t have a ’Stop’ key only a ‘Play/Pause’ key it becomes a problem of how to completely stop media playing when returning to the pre-play screen when pressing ‘Exit’, ‘Return’, ‘Back’ or whatever your TV remote labels the key.

 

All you need to do is create a keymap.xml file in a basic text editor and add the followng:

 

   

            Stop

   

 

and copy the file to the /storage/.plexht/userdata/keymaps directory and restart Rasplex.

 

This has been tested as working on my Sony Bravia TV’s.

 

If this doesn’t work for your TV then run tail -F /storage/.plexht/temp/plexhometheater.log via SSH and press your ‘Exit’, ‘Return’, ‘Back’ or whatever your TV remote labels the key.

 

The output should look like this:

 

12:53:19 T:1867510864   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)

12:53:19 T:1867510864   DEBUG: CecLogMessage - SetCurrentButton exit (d) D:0ms cur:d

12:53:19 T:1867510864   DEBUG: CecLogMessage - key pressed: exit (d) current(ff) duration(0)

12:53:19 T:1867510864   DEBUG: CecLogMessage - Changed key exit (d) D:0ms cur:ff

12:53:19 T:1867510864   DEBUG: CecLogMessage - key pressed: exit (d, 0)

12:53:19 T:1867510864   DEBUG: PushCecKeypress - received key d8 duration 0

12:53:19 T:1867510864   DEBUG: CecLogMessage - CheckKeypressTimeout T:896.385

12:53:19 T:1867510864   DEBUG: CecLogMessage - Key exit: idle (duration:0) (d) timeout:500ms (rel:500,rep:0,prs:1,rel:0)

12:53:19 T:1975984128   DEBUG: OnKey: menu (d8) pressed, action is Back

 

The bit you are interested in is the 'Onkey:' entry in the last line, if your action is any different to ‘Back’ then replace and in the keymap.xml file with your action.

 

Hope this clarifies the situation and helps make your Rasplex experience better.

 

Regards

To solve Back, get codec info and Step forward/Back on LG 42LH3000 remote with CEC:

   
            Back
            ContextMenu
   
   
             CodecInfo
             BigStepForward
             BigStepBack
   

@jdbrookes said:
See attached my custom remote.xml file for my Samsung TV remote.

It fixes the Return and Exit buttons on the remote, which drove me crazy until I used trial and error to eventually fix everything about a year ago.

RETURN button: goes back a screen

EXIT button: goes back to Home screen

Green button: Shows metadata info during playback

Yellow button: Shows context menu

Blue button: Toggles subtitles during playback

Red button: goes back to Home screen (same as EXIT button).

Some of the buttons on the remote that you think would be good for Context Menu, Settings etc cannot actually be mapped as they are reserved for Samsung (eg Tools, Info and Menu buttons)

Rename the attached to remote.xml and copy it to your userdata/keymaps folder. Works in my case for both PHT on a Windows machine (using a HDMI-CEC adapter) and Rasplex on the pi / pi2.

Thanks jdbrookes you are a life saver. :slight_smile:

How do you turn on Debug? I can’t get the CEC keys to come up in Putty at all.??

@arogers75 said:
How do you turn on Debug? I can’t get the CEC keys to come up in Putty at all.??

Preferences->System->Advanced->Enable debug logging

Regards

Hello,

I have a “strange” button name (panasonic plasma tv)

19:51:45 T:1881142352 DEBUG: CecLogMessage - key released: channel up (30) D:75ms
19:51:45 T:1881142352 DEBUG: PushCecKeypress - received key d2 duration 75 (rep:0 size:0)
19:51:45 T:1881142352 DEBUG: PushCecKeypress - ignored key d2
19:51:45 T:1881142352 DEBUG: CecLogMessage - >> TV (0) -> Playback 3 (B): vendor remote button up (8B)

If i understand the button name is “channel up” so i create the mapping file




VolumeUp</channel up>

</remote>

I tried , , <channel_up> but nothing work. I think space in button name was the issue. How can i resolve this ?

regards

Sorry the xml have a prob in my previous post, my mapping is :

<keymap>
  <global>
    <remote>
      <channel up>VolumeUp</channel up>
  
    </remote>
  </global>
</keymap>

(tried “channel_up” “channel up” “channelup”)

@nhiiiiii:
If it is indeed the space character in “channel up” that triggers the problem, then the real cause of it could be a limitation of the XML parser code. It needs to accept everything between “<” and “>” separators, but might be responding to space as a separator (here identifier terminator) as well.

I’m not sure if this is a coding bug though, as in “failure to implement the intended XML functionality”. Possibly it’s the XML specifications for these keymaps that are ill matched for dealing with the real-life implementations of CEC key names.

But either way it should be possible to fix it by rewriting the parsing code.
Hopefully one of the coders will have a look at this issue.

Best regards: dlanor

@dianor thanks for the infos.

I give an oher try yesterday based on the keyborad/Joystick syntax (http://kodi.wiki/view/Keymap#Keyboards)

 <key id="channel up">action</key>
 <button id="channel up">action</button>

But no success, do you know if there is an alternative syntax for remote ?

Regards

@nhiiiiii said:

do you know if there is an alternative syntax for remote ?

I’m afraid I don’t really know, but then I don’t really use this kind of remote myself.
I use tiny wireless USB keyboards for my RPi units, and they don’t need any special mapping.
The only keymap files I use myself are for mouse, and all keywords and identifiers used there are without space characters, so I’ve never needed to get around that limitation.

I suspect that the XML parser will interpret anything following a space in unquoted text in an XML command as a parameter to the main keyword, and reading the text you linked to I find that most of the examples of quoted text are intended for numeric identifiers only (such as keycodes or button numbers), not arbitrary strings. The only examples I could find of strings with spaces in them were for device names, and those could very well be ‘special cased’ in the parsing. Also, those used the syntax “name=” rather than “id=”, with the latter being used only for numbers in the examples I saw.

I’m not sure if the parser allows something like:

<key name="channel up">action</key>
or
<button name="channel up">action</button>

but it’s what I’d try next anyway…

Best regards: dlanor