#3155636 - 12/12/10 09:23 PM
Speedbrake switch
|
Joined: Dec 2010
Posts: 10
Nesher_ECV56
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 10
Argentina
|
I'm trying to make the speedbrake in Warthog work as I had it in my Cougar with Foxy, on Falcon (AF & OF). When pressing SPDF, I toggle the speedbrakes, so they stay fully opened while the switch is locked forward. They toggle back when I release it. That works well. But when pressing SPDB, I want it to hold Shf+B so the brakes open until I release the switch, and stay opened (not fully though). Then, when I press it again, I want it to hold Ctl+B so the brakes close. I can't get it to work, it opens and closes the brakes fully, as if I just pressed B... This is my code:
// Speedbrake (just below the MIC Switch)
// Press
MapKeyIOUMD(&Throttle, SPDF,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle);
// Release
MapKeyRIOUMD(&Throttle, SPDF,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle,
PULSE+Ckpit_AirBrakesToggle, PULSE+Ckpit_AirBrakesToggle);
MapKeyIOUMD(&Throttle, SPDB,
SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose), SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose),
SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose), SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose),
SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose), SEQ( Ckpit_AirBrakesOpen, Ckpit_AirBrakesClose));
MapKeyIOUMD(&Throttle, SPDM,
0, 0,
0, 0,
0, 0);
I've also tried without the last lines (the SPDM ones), and it works exactly the same. On Foxy I have:
BTN T9 /T /H Ckpit-Air_brakes_open /T /H Ckpit-Air_brakes_close
BTN T10 /P Ckpit-Air_brakes_toggle /R Ckpit-Air_brakes_toggle
And it works flawlessly... Please help!
|
|
#3155827 - 12/13/10 04:30 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Jul 2005
Posts: 1,508
Teej
Member
|
Member
Joined: Jul 2005
Posts: 1,508
|
Wow. If it works for you, great. But what you're trying to do would confuse/annoy the hell out of me. I prefer the standard behavior. (pull back to progressively open, push forward to progressively close, no function in middle)...and it annoys me that this isn't possible in FC. I'll give it some thought, but I'm a bit tied over the next day or two....and don't have falcon installed to test with right now.
Last edited by Teej; 12/13/10 04:33 AM.
|
|
#3155833 - 12/13/10 04:48 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Jul 2005
Posts: 1,508
Teej
Member
|
Member
Joined: Jul 2005
Posts: 1,508
|
The following doesn't have your macros loaded, but I just wanted to see if it worked in text mode...and it seems to.
MapKey(&Throttle, SPDF, PULSE+'T');
MapKeyR(&Throttle, SPDF, PULSE+'T');
MapKey(&Throttle, SPDB, SEQ( 'O', 'C'));
With that I get a "T" when I push the switch forward and release it from forward. (toggle) Pulling back I get a bunch of "O" or "C" (open, close) as would fit your description for how you want your brakes to work. (If you're not using the IOUMD layers on that switch, it's OK to just use mapkey and make it easier to read/write). T
|
|
#3155882 - 12/13/10 08:29 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Sep 2010
Posts: 104
Dimebug
Member
|
Member
Joined: Sep 2010
Posts: 104
France
|
In AF, you can't precisly control the airbrake position, it fully opened or closed, at least from what i know. the command use for this are L_SHIFT+'b' and L_CTL+'b'.
Can't test in OF yet.
following you request, the right code for SPDB should be:
MapKey(&Throttle, SPDB, SEQ(L_SHIFT+'b',L_CTL+'b'));
But as the keystroke order fully open and fully close... sounds not possible.
I AF, it's also not possible to control the Airbrake with an axis, this could have been an alternate solution. In this case we could have programmed the SPDB to trim the axis sequentially.
Guillaume "Dimebug" Leleve
|
|
#3156203 - 12/13/10 07:37 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Jul 2005
Posts: 1,508
Teej
Member
|
Member
Joined: Jul 2005
Posts: 1,508
|
OK...did a little bit of testing. I can make the brakes work as they should in AF with the Warthog but it's not quite so straightforward. I think I can make it work the way you want it to also, Nesher, but I'm not positive on that.
In short it has to do with how TARGET handles multi-key commands (ie shift-b). What TARGET is doing when you release the control is releasing the keys in the same order they were pressed...so for a lshft-b, it releases the left shift key, then releases the b key. That's why their default AF profile doesn't work right.
I just did a test making the 'press' event for the fore/back movement of the speedbrake switch be the shift-b or ctrl-b command with a 'press' function....then I made 2-step 'release' events that released the 'b', then the ctrl or shift...and it works as it should (although not the way Nesher wants yet - haven't tried that setup).
In practice this would have to be done in script rather than in the GUI, because you'd want to put some commands/delays/flags/whatever in so that after the SPDF had been held for sufficient seconds, it would release the keypress anyway.
Last edited by Teej; 12/13/10 07:40 PM.
|
|
#3156249 - 12/13/10 08:27 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Dec 2010
Posts: 10
Nesher_ECV56
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 10
Argentina
|
Teej wrote: Wow. If it works for you, great. But what you're trying to do would confuse/annoy the hell out of me Well, in fact it's not that confusing. When the speedbrake switch is locked forward, I know my brakes are fully opened. And if I need my brakes to partially open, I can press back on the speedbrake switch. After that, it would be logical to close them, so another push back on the speedbrake switch closes them. Dimebug wrote: In AF, you can't precisly control the airbrake position, it fully opened or closed, at least from what i know. the command use for this are L_SHIFT+'b' and L_CTL+'b'.
That is not accurate at all. While holding down the L_SHIFT+b, the brakes open, and when you release the keys they stop opening. The same happens with L_CTL+b. I have those same keys mapped for Ckpit_AirBrakesOpen and Ckpit_AirBrakesClose on my Macro file. In OF it works exactly the same. Teej wrote: In short it has to do with how TARGET handles multi-key commands (ie shift-b). What TARGET is doing when you release the control is releasing the keys in the same order they were pressed...so for a lshft-b, it releases the left shift key, then releases the b key. That's why their default AF profile doesn't work right.
Mmmm... that sounds about right! If I recall correctly now, I had the same problem with the Cougar and Foxy because of this, so I assigned different keystrokes for opening and closing the brakes, which were simple keys, not combined with Shift or Control. And then a firmware update fixed that issue! So, with Target's enhanced programmability ( is that a word? ), I wouldn't need to change the keystrokes in the sim, I think I could make it work like this:
MapKeyIOUMD(&Throttle, SPDB,
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')),
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')),
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')),
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')),
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')),
SEQ(CHAIN(DOWN+L_SHIFT,D(50),DOWN+'b',D(50),UP+'b'),
CHAIN(DOWN+L_CTL,D(50),DOWN+'b',D(50),UP+'b')));
MapKeyRIOUMD(&Throttle, SPDB,
CHAIN(UP+L_CTL,UP+L_SHIFT), CHAIN(UP+L_CTL,UP+L_SHIFT),
CHAIN(UP+L_CTL,UP+L_SHIFT), CHAIN(UP+L_CTL,UP+L_SHIFT),
CHAIN(UP+L_CTL,UP+L_SHIFT), CHAIN(UP+L_CTL,UP+L_SHIFT));
Does it look ok? I'll try later when I arrive home where I have the Warthog and the TARGET programming software and let you know
Last edited by Nesher_ECV56; 12/13/10 08:32 PM.
|
|
#3156280 - 12/13/10 09:00 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Jul 2005
Posts: 1,508
Teej
Member
|
Member
Joined: Jul 2005
Posts: 1,508
|
Teej wrote: Wow. If it works for you, great. But what you're trying to do would confuse/annoy the hell out of me Well, in fact it's not that confusing. When the speedbrake switch is locked forward, I know my brakes are fully opened. And if I need my brakes to partially open, I can press back on the speedbrake switch. After that, it would be logical to close them, so another push back on the speedbrake switch closes them. Sounds like I steered you on the right track at least. As I said, I'd never want to sound like I'm forcing you to change what you're doing. My logic is "back = slow, forward = fast". Thus, pulling back on the brakes to open 'em, pushing forward to close 'em. Pull back on the flaps switch to lower, forward to raise. In FC2, I use the pinky switch for the gear....you guessed it...back to lower, forward to raise. If I felt the switch in the middle, I figured I probably had the brakes partially open. Pushed forward, I always knew they were closed. Contrary to your style, I often (in AF, at least) wanted to move the brakes partially from where they were. Open them a bit further, close them a little bit, etc.
Last edited by Teej; 12/13/10 09:01 PM.
|
|
#3156287 - 12/13/10 09:05 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Oct 2010
Posts: 83
Nicu
Junior Member
|
Junior Member
Joined: Oct 2010
Posts: 83
|
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));
Last edited by Nicu; 12/13/10 09:20 PM.
|
|
#3156654 - 12/14/10 08:35 AM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Sep 2010
Posts: 104
Dimebug
Member
|
Member
Joined: Sep 2010
Posts: 104
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
|
|
#3156860 - 12/14/10 04:07 PM
Re: Speedbrake switch
[Re: Nesher_ECV56]
|
Joined: Dec 2010
Posts: 10
Nesher_ECV56
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 10
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!!
|
|
#3157177 - 12/14/10 10:32 PM
Re: Speedbrake switch
[Re: Teej]
|
Joined: Dec 2010
Posts: 10
Nesher_ECV56
Junior Member
|
Junior Member
Joined: Dec 2010
Posts: 10
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.
|
|
|
|
|
|
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
|
|
|
|
|
|
|
|