Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 19 made on Monday January 2, 2012 at 09:27
Guy Palmer
Active Member
Joined:
Posts:
June 2008
648
Steve,

I think you just need to take a deep breath and try and understand how the Prontos work.  I'll try and explain again:

a. Actions are selected from the dropdown boxes in actions tab.  They are basically restricted to a) sending IR commands and b) jumping between pages.  When you press a button which contains some actions, these actions are executed.

b. Prontoscript (which is Javascript with a few extras) can be used to do lots of things (e.g. in your case, set values for variables or do conditional logic) but it can't directly either a) send IR commands or b) jump between pages.

c. To get round this, Phillips added two prontoscript commands - i.e. scheduleActions() and executeActions() - which allow scripts to invoke actions which are on buttons and thus allow prontoscript to effectively send IR commands and to jump between pages.

So, the way one does something is to do it all in prontoscript, occassionally jumping out using scheduleActions/executeActions when you want to either send an IR commmand or jump to a different page.

Putting this another way: Prontos handle IR commands and TCP commands in completely different ways: IR commands are handled by actions (which can be invoked by either pressing the relevant button or by using scheduleActions/executeActions in prontoscript); TCP commands are handled within prontoscript and not by actions.  By contrast, prontos handle TCP commands, setting variable values and conditional logic in similar ways: i.e. within prontoscript

Or another way: scheduleActions/executeActions only work when what you want to do is limited to sending IR commands and/or jumping pages.

The code you have written:

if (keyboardState == 0) // unshifted
CF.widget("KeyA", "Unshifted").scheduleActions();
else if (keyboardState == 1) // shifted
CF.widget("KeyA", "Shifted").scheduleActions();

will work in that it will invoke the action lists in the relevant "KeyA" button.  But it can't be used to set the keyboard state to 0 or 1 as "set the keyboard state to 0 or 1" is not an action and, by definition, is not part of your action list in the "KeyA" button.

Perhaps your confusion comes from the fact that, oddly, the way that one adds prontoscript to a button is to go to the action tab, then press the prontoscript button in the top right hand corner, then write prontoscript commands in the window that appears.  But that window is actually nothing to do with actions and the prontoscript commands that you put there can only be invoked by actually pressing the button itself.


Hosting Services by ipHouse