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 20 made on Monday January 2, 2012 at 10:42
Stealth
Long Time Member
Joined:
Posts:
December 2003
72
Guy, you have the patients of a saint. Thanks for sticking with me….

Your explanation makes more sense to me know (I think!)

I will need to do some research to understand when to use scheduleActions over executeActions though!

On January 2, 2012 at 09:27, Guy Palmer said...
Steve,

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.

Ok I think I’m still with you, in so much that I can’t use the set variable to check my keyboard is switching with that .scheduleActions code. However I could use jump to another page with the actions list on both KeyA on the Unshifted & Shifted pages…. Correct?

I have tried this and it’s still spitting out an error:-

ProntoScript error: TypeError: CF.widget("KeyA", "Unshifted") has no properties
Offending button script: Tag: 'KeyA'
Offending line #3: "CF.widget("KeyA", "Unshifted").scheduleActions();".

Just to confirm. I have an overlay which is a clone of two additional pages. One called Unshifted and the other Shifted. I have a key on each all called KeyA. On the overlay KeyA has the following code:-

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

Now on the Unshifted page, KeyA, I have set the following action:-
Jump: Home – Test1

On the Shifted page, KeyA, I have set the following action:-
Jump: Home - Test2

On my tests I am pressing KeyA on the overlay expecting it to action the code on either KeyA on the Unshifted or KeyA on the Shifted page. (Determined by the variable keyboardState set by the Shift key on the overlay)

Either I still completely misunderstand or I have done something wrong.

Can I apologise for the frustration I must be causing you….

Steve


Hosting Services by ipHouse