sendkey function in pythonscript?
#1
Sad 
:nuts: is there a possibility to send a keyfunction like (x)

basicly we need a script wich switches the fullscreenvideo to a custom window with a videowindow like the button x does by pushing.

please help!
Reply
#2
the http api has a sendkey option. you could use python to send this command directly to xbmc's local webserver.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
Star 
Image we know the possibility of sending the x over the webserver!

but how can i send the webserver command over python?

please help guys!
Reply
#4
check the python docs... it's something like xbmc.httpapi('sendkey*****')
Reply
#5
this is the http api command :
Quote:sendkey(buttoncode;[lefttrigger];[righttrigger];[leftthumbx];[leftthumby] ;[rightthumbx];[rightthumby])
o initiates a button, key or mouse event. buttoncode specifies the type of event and the other parameters specify additional information that is specific to each buttoncode value.
 to send a button event just set buttoncode to the appropriate value. e.g. the left_trigger has a buttoncode value of 262. for a full list of buttoncodes see: http://cvs.sourceforge.net/viewcvs....=markup
 to send a keyboard event set buttoncode to f100 (hex) and add the required key’s ascii value.
 (experimental) to send a mouse event set buttoncode to efff (hex) , then set the following parameters:
• leftthumbx – mouse x position
• leftthumby – mouse y position
• lefttrigger – indicates a single mouse click and takes a value of one of 1-left button, 2-right button, 3-middle button.
• righttrigger– indicates a double mouse click and takes a value of one of 1-left button, 2-right button, 3-middle button.
buttoncodes can be found here :
http://cvs.sourceforge.net/viewcvs....=markup

and you'll find for x button (i think it is this one):
Quote:#define key_button_x                        258
and this is how you can use it with python :
Quote:import xbmc
response = xbmc.executehttpapi("sendkey(258)")
response should be something like "<li>ok" if command is recognized
if you want to test it using your favorite webbrowser :
http://192.168.0.3/xbmccmds/xbmchttp?com...ameter=258
(assuming 192.168.0.3 is your xbox ip address and your xbmc web server is on)
Reply

Logout Mark Read Team Forum Stats Members Help
sendkey function in pythonscript?0