Double command from remote
#1
Can I assign a double command to a key of my remote?
I wish to run a script after a command
Thanks
Reply
#2
Depending on your remote, you may be able to map a button in your custom keyboard.xml (wiki) to execute a Python script. The script would issue your desired commands.
Reply
#3
Thanks for answer,
but how can assign 2 command in keyboard.xml?

ie:
<up>up,RunScript(/storage/.xbmc/userdata/script.py)</up>
Reply
#4
As I said in my previous post, your script would run the two commands. In your example, it would be your script.py that contains the two commands you wish to execute with the press of the Up button. By the way, your syntax for the key mapping is incorrect:
Code:
<up>up,RunScript(/storage/.xbmc/userdata/script.py)</up>
it should be:
Code:
<up>RunScript(/storage/.xbmc/userdata/script.py)</up>
Reply
#5
(2012-11-30, 08:59)artrafael Wrote: As I said in my previous post, your script would run the two commands. In your example, it would be your script.py that contains the two commands you wish to execute with the press of the Up button. By the way, your syntax for the key mapping is incorrect:
Code:
<up>up,RunScript(/storage/.xbmc/userdata/script.py)</up>
it should be:
Code:
<up>RunScript(/storage/.xbmc/userdata/script.py)</up>

But how can have "up" before script?
Reply
#6
I repeat (for the third time): Your script (script.py) needs to perform the steps you desire.

You cannot assign two actions in a given key mapping. Instead, you have your key mapping execute a script. The script, in turn, can perform as many actions as you desire. If you want to have your Up button move the cursor up and then do something else, then your script has to perform the cursor Up action and then perform the something else action.

Refer to the examples in these threads:
http://forum.xbmc.org/showthread.php?tid=144476
http://forum.xbmc.org/showthread.php?tid=130420
http://forum.xbmc.org/showthread.php?tid=139509
Reply
#7
How I can have "AudioToggleDigital" from script?
Reply
#8
A Python script with the following contents will move the cursor Up and then toggle the audio setting. I'm assuming this is what you want to do?
Code:
import xbmc

xbmc.executebuiltin( "XBMC.Action(Up)" )
xbmc.executebuiltin( "XBMC.Action(AudioToggleDigital)" )

This script is then executed via RunScript when the mapped button is pressed.
Reply
#9
(2012-11-30, 12:09)artrafael Wrote: A Python script with the following contents will move the cursor Up and then toggle the audio setting. I'm assuming this is what you want to do?
Code:
import xbmc

xbmc.executebuiltin( "XBMC.Action(Up)" )
xbmc.executebuiltin( "XBMC.Action(AudioToggleDigital)" )

This script is then executed via RunScript when the mapped button is pressed.

I'm trying to do a script to switch audio in frodo!!!
Reply
#10
(2012-11-30, 12:15)dtweb Wrote: I'm trying to do a script to switch audio in frodo!!!

Your point being?
Reply
#11
I'm working on your old script. I can change the "guisettings.xml" but must stop and restart video
Reply
#12
Your request was to have a single keypress perform two actions, specifically Up and AudioToggleDigital. I've shown you how to do that. Now you have the foundational knowledge you need if you want to work on something more complex.
Reply
#13
(2012-11-30, 12:43)artrafael Wrote: Your request was to have a single keypress perform two actions, specifically Up and AudioToggleDigital. I've shown you how to do that. Now you have the foundational knowledge you need if you want to work on something more complex.

Before I tryed to change output only with "AudioToggleDigital" and it work good, but only with Dolby Digital and DTS. I set Audio output setting with passthrough device and when I switch with Audiotoggle digital, if I have AC3 or DTS, XBMC send audio to my AVR

Sorry for my bad english!!!
Reply
#14
(2012-11-30, 12:43)artrafael Wrote: Your request was to have a single keypress perform two actions, specifically Up and AudioToggleDigital. I've shown you how to do that. Now you have the foundational knowledge you need if you want to work on something more complex.

I haven't foundational knowledge but I have a brain!!!
Reply

Logout Mark Read Team Forum Stats Members Help
Double command from remote0