Sendkey behaviour changed? in version 7

SendKey functie (HTTP API) doesn't work anymore in version 7
All,

Currently some friends and myself are developing scripts to use a Pronto remote to control Plex. Until recently we were always able to use the http api interface with the command sendkey to generate the same behaviour as f.i. up, down, left and right. However since recently we are not able to use this anymore in version 7 (don't ask me since which version as i am not always updating ... a friend told me that it still worked in version 7.7). Could any of the developers tell me what has changed .. and if it has changed which function is now the preferred function to use with the http api. The pronto does not allow uncommitted writes to a ip sockets so probably future developments for UDP will not work. We have to rely on the http i/f. Furthermore http 'actions' are not a reliable procedure to use as they do not interact as normal keys .. which means the screen remains dimmed for instance if a key is pressed (using actions), and even worse it will crash Plex very often.

If any of the developers would also be so kind to send the source-code (or link) of the http webserver it would be very much appreciated. I will then be able to see why Plex does not close ip-sockets and what for instance the format of a screendump is in detail.

Fot all those who can help me a step further : Thanks!

Rgds,
Rutger


I've noticed the screen dimming behaviour too... maybe submit a bug report?

JayTee:



I was excited to hear about your project on a Pronto script for Plex. Do you have any update or planned release date? I would love to do something like this for my Pronto Pro instead of having to go with Remote Buddy.



waves excitedly from the Users Forum



Sorry for the late reply, All the source for plex can be found here:

[http://github.com/elan/plex/tree/master](http://github.com/elan/plex/tree/master)



Hi Isaac,

Thanks for your reply. I have forgotten to mention that I found the source already. Which makes it even worse for me as the file key.h seems to be the original file from xbmc. However recently the new releases have a different response on the sendkey function in the http api. Together with a friend of mine we did some simple search and try, which resulted in keycodes which work but are completely different from the key.h definitions. This is however not what I hoped.. as the interface I am writing for Plex using Javascript on Pronto devices.. should be stable ;-)
Do you have any information on changes in the http i/f and or keycodes??
I read in a post you (meaning the total crew ;-) are working on a new api for the http i/f? Some more details are very welcome as this might help me in my current development or at least prevents me from my hours of coding which needs additional changes.

Rgds

As far as I know, absolutely no changes have been made to Plex’s HTTP API in recent versions. We occasionally pull changes from XBMC that may be interfering with it though. The new API that’s been mentioned on the forum only relates to the library, not sending key commands - this will likely remain unchanged. Which functions appear to be different? Can you provide some examples? Thanks :slight_smile:




I am still working on it .. however besides the changes in Plex (keycodes etc..) I have a serious issue with the ip i/f when using a Pronto. The Pronto create a ipsocket.. but it seems Plex doesn't kill his socket even when I close it from the Pronto side.. this results in the famous max ipsockets error in Pronto. Furthermore I am trying to find out what Plex sends when I request a screendump over ip (so no intermediate file usage).
As soon as i have a 'stable' version available I can send it to you via PM. Just send me a PM if you are interested. Please indicate which Pronto you use (currently I focus on 9600 and 9800... but it should be similar for the 9300 and 9400 ..)

Rgds


Hi Jam,

Thnx for your swift reply. I just reviewed the key.h file used for Plex. Since the introduction of codes for a Harmony remote the 'normal' keycodes don't work anymore, also the virtual keyboard codes (0x... ) don't work. I am unfamiliar with this code.. but it seems to conflict? or at lest killed some of the functionality in the http api..

The most simple function to test is the Sendkey(270) coe .. which should move up in f.i. menu. It used to work excellent .. but not anymore..
The full command is http://[ip and port plex]/xbmcCmds/xbmcHttp?command=SendKey(270)
The newly added codes for the Harmony do work !!! so Sendkey(300) will move up.. (currently I use this..) but I would like to have the full functionality of Sendkey back ..;)

Rgds

I am seeing this as well. Sendkeys are no longer working in PLEX. They still work in XBMC though.



I have been using Actions as a work around, but the problem there is that the cursor “Actions” do not navigate sub menus. This is holding up the final touches on Crestron interface that I have been working on for a while. I see the same problem with the cursor “Actions” in XBMC as well.



Any insight into this would help.

Hey JayTee,



I am trying the SendKeys that you mentioned above Sendkey(300) is page up and Sendkey(301) is page down. Do you by chance have the other cursor command SendKey values? I have had no luck figuring it out.



Thanks

Never mind. I have it working now. The only code I have not found is the context menu.

Hi Audiocoder,





Glad you found the codes… for everybody else you can view the codes in the key.h file (see previous reply from Isaac for the url). As already mentioned only the harmony keys work since our development friends changed something.

Could anyone from the dev team (like Elan or Isaac) tell me/us where you changed the software regarding the keys… not having the full functionality of all the keys as defined in key.h (especially the virtual keys…) makes life for us as integrators …uhhhh… let’s say very difficult :wink:

I am more than willing to look in the source as long as I know which file to look at. If anyone of the dev team knows what has changed and could relook the changes (to re-enable the standard functionality as in xbmc) … it would be very much appreciated.



Hope to hear from you soon.



Rgds

Nice to see it’s not just me that’s got this problem then :smiley:



I thought I could just use:

http://ipaddress:port/xbmcCmds/xbmcHttp?co…Key({ButtonID}) Replace ButtonID with a key id from key.h, as per this thread.



I’m trying to create a virtual keyboard for the http interface, maybe I’m missing something here though, as if I’m following the documentation correctly the following should send the escape keypress:



xbmcCmds/xbmcHttp?command=SendKey(0xF01B)



The sendkey parameter is 0xF000 for keyboard commands + the ASCII value of the keypress (presumably converted to hex then added) so according to me the value for ESC is 027, so that’s 1B in hex.



Anyway, it doesn’t seem to work. Looks like the XBMC guys have had a similar problem. See their ticket here



Pete

Just tested with the latest XBMC and the following works there to send the 270 key (up)



xbmcCmds/xbmcHttp?command=SendKey(0xF010e)



hex of 270 is 10e, so as before 0xF000 + code from key.h in hex



Looks like that might just work because of the patch I linked to in my last post, but keeping everything in hex is a much better idea than converting ASCII character maps



Hi PeteBest,

I tested this too.. but since the change in Plex when the have added the harmony codes .. all other SendKey 's don't work anymore... so f.i. 270 doesn't work .. nor the virtual keys (using hex codes as described by you). I already dived into the code of Plex but I can't find it.. maybe the devteam knows what they have changed with regard to the Harmony codes.. so they might also know what has gone wrong. I really hope the devteam reads this mail and will reply as this error in the http api interface is a real problem for me as integrator. ... So please devteam.. I know you have many requests but please have a look at this issue.

Rgds

To the devteam,



As an addition to my previous reply/post…The http api call SendKey always replies with OK if a valid keycode is provide. Unfortunately with no action.



Rgds

Did this work in previous versions? If you can pin point the version that it stopped working in you can do a git bisect to find the patch that broke it. If you’re not so good with git and can’t figure that part out let me know some steps to reproduce the issue and the version where it was changed and I can do the bisect for you.




Hi Isaac,

Thanks for your reply. I will find out since which version the sendkey doesn't work anymore. I also read there is a new SVN for xbmc handling an issue with sendkey (I don't know if it has any relation). I dived in the git but got lost ..and couldn't find how to retrieve previous versions and/or differences..
Will be back soon.

Okay, well find out the version it started happening in and steps to test and I’ll do the git part to figure out which patch it was that introduced the problem.

XBMC SVN recently pulled our Harmony code, so if that’s what’s causing the issue it may be present there too. If not, then there’s a fix we’re missing :slight_smile: