I'm struggling with this. I have been at it on and off all day and still can't quite get it to work. Can someone give me a pointer to where I am going wrong please?
Where I am so far:-
a) I have declared two variables on the Action Properties Advanced page like so:-
// 0 = Unshifted (low). 1 = Shifted (Caps)
var keyboardState = 0;
// Check keys output. 5 = No change
var OutputState = 5;
b) On my existing keyboard overlay I have put Lyndel's code on the actions tab for one of the keys labeled "A" and called KeyA as the prontoscript name.
// 0 = Unshifted (low) 1 = Shifted (Caps)
if (keyboardState == 0) // Unshifted
CF.widget("KeyA", "Unshifted").scheduleActions);
else if (keyboardState == 1) // Shifted
CF.widget("KeyA", "Shifted").scheduleActions();
c) I created two new pages called Shifted and UnShifted, Then pasted all the buttons which I copied from my existing keyboard overlay to each of the new pages. On the Shift key actions tab for Shifted I put the following code:-
keyboardState = 1;
And for the Unshifted shift key:-
keyboardState = 0;
d) On the first key for both pages and the overlay I have named them all as KeyA for the Prontoscript Name.
e) I have set the actions for KeyA on the Shifted page as:-
OutputState = 6;
And for Unshifted:-
OutputState = 10
I did this so to confirm the key actions are changing when the shift key has been operated. When KeyA on the overlay is pressed I am reading the variable Output state into a label so see the output.
f) When I run my test I call the overlay from a hard button and press KeyA, but nothing happens (variables are unchanged) I then press the shift key and the keyboard variable changes to 1 as expected. I then press KeyA again and nothing changes..
For the life of me I don’t know what I’m doing wrong. I’m sure its something stupid, please be gentle!
Thanks you for taking the time to read this long post.
Steve