Jump to content
The simFlight Network Forums
Tom68

Compound Button Conditions Question

Recommended Posts

Using FSUIPC 4.974 , FSX SP2, WIndows 7. 

Is there a way to use these to conditionally write to an offset instead of specifying a button action?

I'm trying to control a magneto with a rotary switch.  I can use 4 buttons, but I could get away only 3 if I could set the offset to 0 when none of the other three switches were on. 

I tried   24=CP(-jB,b0)(-jB,b6)(-jB,b12),Cx02000892,x0000 << ERROR 19! Line ignored >>

Which of course didn’t work.

I also tried  24=CP(-jB,b0)(-jB,b6)(-jB,b12),C65927,0 << ERROR 19! Line ignored >>    Also didn't work (65927 is the control for magneto 1 off).

Thanks
Tom

Share this post


Link to post
Share on other sites

Tom,

Pete or John may intervene if I flub this up..
I believe you are getting confused in the FSUIPC document. You have his example definitions as actual code.
EX..
(-jB,b0)
The "-" signifies that the button is unpressed, + is pressed
The jB signifies the device. If you have AutoAssignLetters=Yes then this will be a single letter, otherwise will be a number.
The b# signifies the button on the said device, will be a number.
Also, the last definition is the trigger, not the conditions(s) and shouldn't be in parentheses.

Given AutoAssignLetters=Yes and your device is letter "D" the code, using buttons 0 & 6 as conditions (both unpressed) and 12 as the trigger -
24=CP(-D,0)(-D,6)D,12,C65927,0 

Not using AutoAssignLetters and your device is number "3" the code, using buttons 0 & 6 as conditions (both unpressed) and 12 as the trigger -
24=CP(-3,0)(-3,6)3,12,C65927,0

Good luck..
Roman

 

Share this post


Link to post
Share on other sites

Roman,

Thanks I appreciate your reply; but I think you've missed my main question. 

I think I do understand, I just didn't realize the 'j' and 'b' shouldn't be included.  'B' was my joystick I'm using.

It looks like your first example will use the conditions of the first two buttons (D,0) and (D,6) to enable (D,12).  That's not what I'm trying to do.

I want to set C65927 = 0 when none of the three buttons are pressed.

Share this post


Link to post
Share on other sites

Tom,

Ahh, I see now.. I believe you will need to monitor all 3 buttons with conditions on all 3. First off, need to change the CP (compound press) to CU (compound unpress / release) then have three conditional button monitors on 3 (not 4 buttons) EX -

24=CU(-B,0)(-B,6)B,12,C65927,0
25=CU(-B,0)(-B,12)B,6,C65927,0
26=CU(-B,6)(-B,12)B,0,C65927,0

Even better, but may not work if real speedy movements are made with the rotary switch.
Magneto order, with pseudo example button #s -
OFF (none) --> L Mag (#1) --> R Mag (#2) --> Both (#3) --> Start (#4)
So if turning things off (right to left) then all you need to monitor the unpress of #1 and make sure #2 doesn't get pressed to trigger the Mag Off.

 24=CU(-B,2)B,1,C65927,0

Any of the above could be dependant on the rotary switch types - "make before break" or "break before make" and the polling speed of your hardware, just needs testing..

Roman

Share this post


Link to post
Share on other sites

Roman,

Thanks very much!  Your first example worked quite well.

I didn't try your second idea, but I may when I have some time.

Tom

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.