Jump to content
The simFlight Network Forums

Using toggles as momentary?


Recommended Posts

Is there a way to use a toggle (on/off) type to only be seen as a momentary contact, such as a keypress?

In FSUIPC you mean? You don't say.

If you want it to do the same action when it goes from On to Off as it does when it goes from Off to On, just program the same action for "Release" as for "Press". This is surely easy to understand? After all:

"Press" is off -> on.

"Release" is on->off

FSUIPC doesn't know what sort of switch it is. It only sees those transitions.

Pete

Link to comment
Share on other sites

Sorry to be unclear.

I do mean in FSUIPC.

Basically, I want to use a rotary (12 position ) switch to give a momentary pulse eactime I turn it 1 position.

In other words, in each detent of the switch, I would like the PC just to see a keypress and release and stay released till I advance it to the next detent position where it would repeat the keypress and release etc.

Thanks

Link to comment
Share on other sites

In other words, in each detent of the switch, I would like the PC just to see a keypress and release and stay released till I advance it to the next detent position where it would repeat the keypress and release etc.

Erassuming that somehow your switch is looking "closed" then "open" (i.e. pressed and released) as you are turning it, isn't that the same as programming only the "off to on", as for a button. Just don't program the on to off in that case.

If your switch signals nothing on each turn then it cannot be used for anything anyway, can it?

You seem to be thinking this is complicated when surely it is easy. Please think about it a moment longer and re-read what I said already.

ALL any software can possibly see of a switch is its changing from off to on or on to off. You can program one or other or both, as you like. How much more flexibility can you get?

If you are programming a keypress from a button press in FSUIPC's buttons option, you have the additional option of having the key held pressed or not. So the keypress can do "KEY DOWN" and "KEY UP" each time, or "KEY DOWN" but not "KEY UP" till you move the switch again.

Surely all this is pretty obvious. If you are not understanding then obviously I'm missing something, but I'm pretty sure everything is covered by the options as documented and explained.

Regards

Pete

Link to comment
Share on other sites

Thank you Peter

The switch gets closed and remains closed physically. It stays this way untill I have to use it again.

I have a 12 position rotary switch. With each turn(click) of the switch, I want to activate( for example) a range increase on a HSI (horizontal Situation indicator).

If the switch remained in the closed state, it would be like me holding the key down and the range would increase all the way to maximum with just one click.

Having each turn, just send a momentary pulse instead, will allow the range to increase by only 1 step.

[

Norm

Link to comment
Share on other sites

The switch gets closed and remains closed physically. It stays this way untill I have to use it again.

Yes, I understood that. You think I'm the idiot?

But when you turn it it has to go unclosed again before going closed on the next position, right? Else it is a useless switch. So it goes off-to-on, then on-to off, just like any other switch. That is all a switch can really do, you see?

I have a 12 position rotary switch. With each turn(click) of the switch, I want to activate( for example) a range increase on a HSI (horizontal Situation indicator).

:-( Groan. You are evidently not reading anything I say. How many more ways do I have to say the same EXTREMELY simple thing?

Each time you turn your switch and it makes contact, that is an "off" to "on" change. That is the same as a PRESS of a button. Therefore all you need to do is program the PRESS to do what you want!!!

If the switch remained in the closed state, it would be like me holding the key down

No it is not. It is NOTHING like holding a key down UNLESS you tell FSUIPC you want to do this! I have already explained this!!!

Please go and re-read what I said. I really cannot explain such a simple concept any better. I do not understand why you cannot see that it is NOT the state ofv the switch you are programming, but the CHANGE, from off to on, or on to off, or both, as you like!!

Think CHANGE not STATE!!!

What can't you understand what "off to on" and "on to off" mean? These are simply short words. There is nothing complicated here. You seem to think it is. Why?

I am off to bed now, it is late here. Please go and think about things for rather longer than you appear to have done so far and maybe the light will dawn. :-(

A further thought. if you don't understand words, why not just go and try it? I'm sure you'll see what I mean. I have run out of ways to say it anyway.

Pete

Link to comment
Share on other sites

Hi,

What Pete wants to say is that FSUIPC sees only the change of the button state and remembers this during the whole button scan.

So in your case and I suppose now that the rotary switch is on joystick 3, button 1.

1=P3,1,your command,param

If you turn the rotary FSUIPC will see the change from OFF to ON and execute the command. In the next scans, your rotary will be ON but there is no change of state, so there is no execution of the command. This change is remembered during a whole scan, example:

1=P3,1,command 1,param

2=P3,1,C1006,10

3=CP(F+10)3,1,command2,param

4=CP(F-10)3,1,command3,param

I am using the SAME change of state of the SAME button for the execution of these 4 rows, the OFF-ON state transition of button 1 of joy stick 3 does:

1 executes command 1

2 toggles a dummy switch (OFF->ON or ON->OFF)

3 if the internal switch is set, do command 2

4 if the internal switch is not set, do command 3

Thus, every time the button 1 of joystick 3 goes from OFF to ON, command 1 is executed, but command 2 is only executed the 1st, 3th, 5th... time, command 3 only the 2nd, 4th, 6thtime.

It totally disregards if the switch is ON or OFF, it only reacts when the switch is going from OFF to ON, except for the status of the internal dummy switches , here (+F10) or (-F10)

Regards,

Hugo

Link to comment
Share on other sites

Yes, I understood that. You think I'm the idiot?

Very constructive, comment? Not called for.

Having been an instructor for many years, I learned that individuals react differently to explanations of topics and, sometimes need the solution to be re-defined using different terminology before it sinks in. Unfortunately, this one took me a couple of tries before it became clear.

If this caused you frustration, my apologies.

The good news is, that, I can now finally see what was I was missing in the explanations, the light came on at the end of the tunnel.

Hugo, your post, combined with Pete's, did the trick

Thanks to you both

Norm

Link to comment
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
×
×
  • Create New...

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.