|
|
|
#3156287 - 12/13/10 04:05 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Junior Member
Registered: 10/31/10
Posts: 40
|
I think the minimal code with the desired effect is the following (b pulsed): MapKey(&Throttle, SPDB, SEQ(CHAIN(DOWN+L_SHIFT+'b', D(), UP+'b', UP+L_SHIFT),
CHAIN(DOWN+L_CTL+'b', D(), UP+'b', UP+L_CTL))); Or, if you need 'b' held: MapKey(&Throttle, SPDB, SEQ(DOWN+L_SHIFT+'b', DOWN+L_CTL+'b'));
MapKeyR(&Throttle, SPDB, CHAIN(UP+'b', UP+L_SHIFT+L_CTL));
Edited by Nicu (12/13/10 04:20 PM)
|
|
Top
|
|
|
|
#3156654 - 12/14/10 03:35 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Member
Registered: 09/18/10
Posts: 103
Loc: France
|
Ok, i've done some testing, in fact to have a control of each steps of the Airbrakes, you have to hold the Shift or Control Key, then pluse 'b' for each steps.
If you release the Shift or control to early, the airbrake will go to fully opened or closed position.
here is an example of what works. To repeat the pulsed 'b', i've used REXEC. I've released the shift key using a MapKeyR, what's interesting here is that i had to create a chain to make it wait some time to be sure that the repeat of the REXEC and the time of pluse is finished before releasing the shift key. If i don't do this, it's not 100% reliable.
Example of code :
MapKey(&Throttle, SPDB, CHAIN(DOWN+L_SHIFT+'b', REXEC(0, 20,"ActKey(KEYON+PULSE+'b');"))); MapKeyR(&Throttle, SPDB, CHAIN(0, D(), UP+L_SHIFT+'b')); MapKey(&Throttle, SPDF, CHAIN(DOWN+L_CTL+'b', REXEC(0, 20,"ActKey(KEYON+PULSE+'b');"))); MapKeyR(&Throttle, SPDF, CHAIN(0,D(),UP+L_CTL+'b'));
You should easyly mix this in a SEQuence on the same button. I really have to go :-)
_________________________
Guillaume "Dimebug" Leleve
|
|
Top
|
|
|
|
#3156806 - 12/14/10 09:54 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Veteran
Registered: 04/05/02
Posts: 17733
Loc: Bridgewater, NJ
|
Given Dimebug's discovery, what happens if F4:AF speedbrake controls are mapped to single keystrokes and not chorded keystrokes?
|
|
Top
|
|
|
|
#3156860 - 12/14/10 11:07 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Junior Member
Registered: 12/11/10
Posts: 10
Loc: Argentina
|
Yeepeeeee!! I made it work! So, for the sake of easiness of reading (and since I didn't know I could use MapKey with layers instead of MapKeyIOUMD), this is what I used to have, that didn't work:
MapKey(&Throttle, SPDB,
SEQ(Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose));
// Ckpit_AirBrakesOpen is defined on the Macro file as L_SHIFT+'b'
// Ckpit_AirBrakesClose is defined on the Macro file as L_CTL+'b'
This is what I have now, and it works like a charm!
// Press
MapKey(&Throttle, SPDB,
SEQ(CHAIN(DOWN+L_SHIFT,D(20),DOWN+'b'), CHAIN(DOWN+L_CTL,D(20),DOWN+'b')));
// Release
MapKeyR(&Throttle, SPDB,
CHAIN(UP+'b',D(20),UP+L_SHIFT,UP+L_CTL));
Thanks everyone for the help, especially Teej!!
|
|
Top
|
|
|
|
#3156864 - 12/14/10 11:11 AM
Re: Speedbrake switch
[Re: Joe]
|
Junior Member
Registered: 12/11/10
Posts: 10
Loc: Argentina
|
Given Dimebug's discovery, what happens if F4:AF speedbrake controls are mapped to single keystrokes and not chorded keystrokes? It should work with my first code. But if I can find another solution, I tend not to change the default simulator keystrokes. That way, I can distribute my profile and not worrying about something not working because of keystroke changes. And it's not that difficult for this to work without changing keystrokes! As you can see, I just had to change a line (and it's not a complex instruction) and then add another for the release. That was all! 
|
|
Top
|
|
|
|
#3156916 - 12/14/10 12:00 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Member
Registered: 07/02/05
Posts: 1503
|
Yeah, the explicit pulsing isn't required...as Nicu posted, you can do it by specifying the key release order explicitly instead.
@Nesher: one gotcha is your last line is releasing both lshift and lctrl - what if something else has one of those held down for something (Hence the suggestion for remapping or using dx buttons)
|
|
Top
|
|
|
|
#3157177 - 12/14/10 05:32 PM
Re: Speedbrake switch
[Re: Teej]
|
Junior Member
Registered: 12/11/10
Posts: 10
Loc: Argentina
|
Yeah, the explicit pulsing isn't required...as Nicu posted, you can do it by specifying the key release order explicitly instead.
@Nesher: one gotcha is your last line is releasing both lshift and lctrl - what if something else has one of those held down for something (Hence the suggestion for remapping or using dx buttons) In my profile, nothing stays pressed after it's done. And it wouldn't be normal that you press more than one button at a time. If I ever run into that problem, I'll try another solution. But I don't think that will be an issue.
|
|
Top
|
|
|
|
|
|
| |