Lev
25-12-2004, 04:09 PM
First off, I just want to say how impressed I am with the support provided here for CH products - one of the reasons I got my Fighterstick and Pro Throttle about a week ago. In the last week, I've had more fun programming my controls and learning scripting than actually using them. I'm blown away with what you can do with CMS scripting. Way to go, everyone! :thumbsup:
So here's what I'd like to do, but I just can't seem to get it to work. While I've succeeded in copying JNOV's script (for Falcon 4) for making a button send one command when pressed quickly and work as a shift key when held down, I can't for the life of me get a button to send one command when pressed quickly and hold another command when held down.
For instance, I'd like Fighterstick Hat 2 UP (js1.b9) to send cms.b9 when quickly pressed up, but to send cms.b65 when held up. I have programmed cms.b65 to be HOLD RALT RCTL, and Left, Right, and Down to be similar modifiers, so that I can hold them while pressing the keypad to simulate Falcon 4's OSB buttons (don't even know if that's going to work yet :blink: ).
Here's where I've gotten. It seems to work, though if I hold Up followed by a quick select Up, then I seem to get some extra keypresses, which I can't figure out. There's probably a better way to do this, that is more elegant and actually works. (And it would probably be a good thing if I actually understood the various time parsing scripts).
//////////////////////////
script
timer(period, d2, 5) = js1.b9 and not d2; //////Quick Select for Up
sequence
wait(d2 and not js1.b9 and not (ls1 or ls2 or ls3) );
cms.b9 = TRUE;
delay(2);
cms.b9 = FALSE;
endsequence
timer(period, d3, 5) = js1.b10 and not d3; //////Quick Select for Right
sequence
wait(d3 and not js1.b10 and not (ls1 or ls2 or ls3) );
cms.b10 = TRUE;
delay(2);
cms.b10 = FALSE;
endsequence
timer(period, d4, 5) = js1.b11 and not d4; /////Quick Select for Down
sequence
wait(d4 and not js1.b11 and not (ls1 or ls2 or ls3) );
cms.b11 = TRUE;
delay(2);
cms.b11 = FALSE;
endsequence
timer(period, d5, 5) = js1.b12 and not d5; //////Quick Select for Left
sequence
wait(d5 and not js1.b12 and not (ls1 or ls2 or ls3) );
cms.b12 = TRUE;
delay(2);
cms.b12 = FALSE;
endsequence
if (not (d2 or d3 or d4 or d5) ) then //////These are the Hold keys
cms.b65 = js1.b9;
cms.b67 = js1.b10;
cms.b69 = js1.b11;
cms.b71 = js1.b12;
endif
endscript
So here's what I'd like to do, but I just can't seem to get it to work. While I've succeeded in copying JNOV's script (for Falcon 4) for making a button send one command when pressed quickly and work as a shift key when held down, I can't for the life of me get a button to send one command when pressed quickly and hold another command when held down.
For instance, I'd like Fighterstick Hat 2 UP (js1.b9) to send cms.b9 when quickly pressed up, but to send cms.b65 when held up. I have programmed cms.b65 to be HOLD RALT RCTL, and Left, Right, and Down to be similar modifiers, so that I can hold them while pressing the keypad to simulate Falcon 4's OSB buttons (don't even know if that's going to work yet :blink: ).
Here's where I've gotten. It seems to work, though if I hold Up followed by a quick select Up, then I seem to get some extra keypresses, which I can't figure out. There's probably a better way to do this, that is more elegant and actually works. (And it would probably be a good thing if I actually understood the various time parsing scripts).
//////////////////////////
script
timer(period, d2, 5) = js1.b9 and not d2; //////Quick Select for Up
sequence
wait(d2 and not js1.b9 and not (ls1 or ls2 or ls3) );
cms.b9 = TRUE;
delay(2);
cms.b9 = FALSE;
endsequence
timer(period, d3, 5) = js1.b10 and not d3; //////Quick Select for Right
sequence
wait(d3 and not js1.b10 and not (ls1 or ls2 or ls3) );
cms.b10 = TRUE;
delay(2);
cms.b10 = FALSE;
endsequence
timer(period, d4, 5) = js1.b11 and not d4; /////Quick Select for Down
sequence
wait(d4 and not js1.b11 and not (ls1 or ls2 or ls3) );
cms.b11 = TRUE;
delay(2);
cms.b11 = FALSE;
endsequence
timer(period, d5, 5) = js1.b12 and not d5; //////Quick Select for Left
sequence
wait(d5 and not js1.b12 and not (ls1 or ls2 or ls3) );
cms.b12 = TRUE;
delay(2);
cms.b12 = FALSE;
endsequence
if (not (d2 or d3 or d4 or d5) ) then //////These are the Hold keys
cms.b65 = js1.b9;
cms.b67 = js1.b10;
cms.b69 = js1.b11;
cms.b71 = js1.b12;
endif
endscript