Map trigger (Figtherstick button 1) to shoot guns & laser
-
This is actually directed to ewildcat to help me (really sorry to disturb you on this, but ever since I’ve been able to program the pinky switch to function as AP paddle and pinky as in an earlier thread, I really like to get my Fighterstick to work as close as possible to the real HOTAS)
I tried programming my Fighterstick button 1 (trigger) to function as BOTH “1st detent” and “2nd detent” on a single press.
That way, I can shoot the guns in AA mode or shoot the laser in AG LGB drops using the trigger as in the real HOTAS (minus the detent thingy)I tried the following already:
Using the CMS script I programmed Fighterstick trigger (JS1.B1) to operate the cms.b2 and cms.b3.
Then in CMS Controls b2 is mapped to key " \ " (which is mapped to 1st trigger detent in SETUP UI) and b3 is mapped to key " / " (which is mapped to 2nd trigger detent in SETUP UI).
It works perfectly for shooting the guns.But not quite for shooting the laser. When the trigger is pressed, the laser shoots, but when the trigger is released the laser is still shooting and doesn’t stop (“L” on TGP continues flashing).
There is a thread about this (https://www.benchmarksims.org/forum/showthread.php?29879-Laser-permanently-lasing-after-short-manual-lase&highlight=laser) and a good reply by I-Hawk at post #11, but the solution is not there for the CH.Hopefully someone (ewildcat) can help me out here.
Thank you in advance!!! -
I-Hawk’s analysis is on spot. Here’s a script that you should get you the result you’re looking for :
CMS.B3=JS1.B1;
sequence
wait(not JS1.B1);
delay(1);
CMS.B2=true;
delay(1);
CMS.B2=false;
delay(1);
endsequenceThe red part means the 2ndTriggerDetent callback is depressed when button 1 is depressed and released when button 1 is released.
The green part means that each time button 1 is released the 1stTriggerDetent callback is activated after a 50 ms delay, then deactivated after another 50 ms delay. -
I-Hawk’s analysis is on spot. Here’s a script that you should get you the result you’re looking for :
CMS.B3=JS1.B1;
sequence
wait(not JS1.B1);
delay(1);
CMS.B2=true;
delay(1);
CMS.B2=false;
delay(1);
endsequenceThe red part means the 2ndTriggerDetent callback is depressed when button 1 is depressed and released when button 1 is released.
The green part means that each time button 1 is released the 1stTriggerDetent callback is activated after a 50 ms delay, then deactivated after another 50 ms delay.Thank you for the quick reply!
However, I tried the script you provided, nil fix.
Laser still shoots after trigger is pressed and released.However, if it will help you, the information I gathered is as follows:
Key " \ " = 1st detent (shoot laser) CMS.B2
Key " / " = 2nd detent (shoot guns) CMB.B3Both CMS.B2 & CMS.B3 is activated by JS1.B1 (Fighterstick button #1 which is the trigger)
Using your script above, I noticed that once I pressed the trigger to shoot the laser, the laser keeps shooting. Even after pressing the trigger again it still remains shooting.
The only way I found to get the laser to stop shooting is if I press on the keyboard the key " \ " which is 1st detent.Hope this information helps and you can help me with a script on that.
Thank you again!!!
-
Did you erase any other mention of CMS.B2, CMS.B3 or JS1.B1 in the CMS file before copying the script ?
-
Did you erase any other mention of CMS.B2, CMS.B3 or JS1.B1 in the CMS file before copying the script ?
This is my script in italics:
_script
// Fighterstick Trigger activates both laser & guns
cms.b2=js1.b1;
cms.b3=js1.b1;
sequence
wait(not JS1.B1);
delay(1);
CMS.B2=true;
delay(1);
CMS.B2=false;
delay(1);
endsequenceendscript_
I did play around the the script, getting a rough idea how it works now. What’s the reason for the command line delay(1) at the end just before endsequence?
-
Kenguan, with all due respect, what about testing the actual script I suggested instead of a personal variation ?
As for the delay, it’s a mere precaution : by experience I know that sometimes CHCM doesn’t like actions to follow each other too quickly. But I admit the very last delay is probably not necessary here.
-
Sorry, my posted script has the “cms.b2=js1.b1” because I assigned b2 to keystroke " \ " which is 1st detent (shoot laser) which I notice was not in your script.
When I tried your script verbatim (without my added cms.b2=js1.b1) the guns could not shoot, but the laser worked perfectly.
After many attempts, I found a solution!
I programmed a simple:cms.b2=js1.b1;
cms.b3=js1.b1; which was what I tried originally (making both 1st detent and 2nd detent to be operated by the push of the trigger).
But,
after much playing about, I found that for the laser to stop shooting, the last keystroke it must sense is 1st detent released.
I realised that since I programmed CMS.B2 to " \ " 1st detent and CMS.B3 to " / " 2nd detent, when I checked in the Key Check of CH Ctrl Mgr, on pressing and releasing the trigger it showed:
Pressed:
Pressed: /
Released :
Released: /That means what it sensed last is " / " 2nd detent release.
Reason being is on a single press of trigger it will ‘press’ CMS.B2 " \ " 1st detent first, then ’ press’ CMS.B3 " / " 2nd detent. Same sequence on release.So I just swapped the keystroke for CMS.B2 to " / " 2nd detent and CMS.B3 to " \ " 1st detent.
That way, the last keystroke sensed is 1st detent release.
Problem solved!Thank you very much for your help ewildcat.
Really admire your scripting knowledge.
Reminds me a bit about programming on GWBasic & BasicA back in the old DOS days…