Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#3155636 - 12/12/10 09:23 PM Speedbrake switch  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
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:

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:

Code:
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!

Inline advert (2nd and 3rd post)

#3155827 - 12/13/10 04:30 AM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
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. biggrin

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.

#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3155833 - 12/13/10 04:48 AM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
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.

Code:
	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


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3155849 - 12/13/10 05:23 AM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
Junior Member

Joined: Dec 2010
Posts: 10
Argentina
In the analizer works fine, but in Falcon it doesn't... I used to have the same problem with the Cougar and Foxy some 5 years ago, but I can't remember how I solved it frown

#3155882 - 12/13/10 08:29 AM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Sep 2010
Posts: 104
Dimebug Offline
Member
Dimebug  Offline
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
#3156063 - 12/13/10 04:34 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
Nope, definitely works in AF to have brakes partially open - I know at one point I was telling people to use half-brakes for refueling to make the plane more responsive to power changes.

I don't think there was anything special about it in this particular regard, but I was using Jagstang's profile / keymaps.


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3156203 - 12/13/10 07:37 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
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.

#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3156249 - 12/13/10 08:27 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
Junior Member

Joined: Dec 2010
Posts: 10
Argentina
Quote:
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.

Quote:
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.

Quote:
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? neaner ), I wouldn't need to change the keystrokes in the sim, I think I could make it work like this:

Code:
	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 smile

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 Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
Originally Posted By: Nesher_ECV56
Quote:
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. biggrin

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. biggrin

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.

#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3156285 - 12/13/10 09:03 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Why not just remap the speedbrake keys in-game to single keypresses (not chorded with SHF, CTRL, etc.), or better yet to DirectX button presses? These sorts of problems are why it is always a good idea to remap any buttons that will be held to in-game mappings that use DirectX buttons, not keyboard keystrokes. It will be so much easier that way; the code will be significantly less complex and there shouldn't be any troubleshooting required.

#3156287 - 12/13/10 09:05 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Oct 2010
Posts: 83
Nicu Offline
Junior Member
Nicu  Offline
Junior Member

Joined: Oct 2010
Posts: 83
I think the minimal code with the desired effect is the following (b pulsed):

Code:
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:

Code:
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 Offline
Member
Dimebug  Offline
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
#3156806 - 12/14/10 02:54 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Given Dimebug's discovery, what happens if F4:AF speedbrake controls are mapped to single keystrokes and not chorded keystrokes?

#3156860 - 12/14/10 04:07 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
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:

Code:
	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!

Code:
// 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!!

#3156864 - 12/14/10 04:11 PM Re: Speedbrake switch [Re: Joe]  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
Junior Member

Joined: Dec 2010
Posts: 10
Argentina
Originally Posted By: Joe
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! smile

#3156916 - 12/14/10 05:00 PM Re: Speedbrake switch [Re: Nesher_ECV56]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
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)


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3157177 - 12/14/10 10:32 PM Re: Speedbrake switch [Re: Teej]  
Joined: Dec 2010
Posts: 10
Nesher_ECV56 Offline
Junior Member
Nesher_ECV56  Offline
Junior Member

Joined: Dec 2010
Posts: 10
Argentina
Originally Posted By: Teej
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.


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
10 Years ago MV Sewol
by wormfood. 04/15/24 08:25 PM
Pride Of Jenni race win
by NoFlyBoy. 04/15/24 12:22 AM
It's Friday: grown up humor for the weekend.
by NoFlyBoy. 04/12/24 01:41 PM
OJ Simpson Dead at 76
by bones. 04/11/24 03:02 PM
They wokefied tomb raider !!
by Blade_RJ. 04/10/24 03:09 PM
Good F-35 Podcast
by RossUK. 04/08/24 09:02 AM
Gleda Estes
by Tarnsman. 04/06/24 06:22 PM
Food Safety and Bad Roommates
by KRT_Bong. 04/04/24 02:16 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0