Jump to content
Sign in to follow this  

Toggle between 2 values with one Button / Key

Recommended Posts

Is it possible to have one key do a toggle without scripting? I'm working with the Captain Sim 757, and I want Shift+T to toggle the taxi light, one push does value 1 next push does value 0, etc.

The taxi light switch is a local variable called "L:O12_006_SW2".

I've already made a working script for this, but is there a more obvious way just using the already available settings? I just didn't want to have to repeat this numerous times.


Edited by atav757

Share this post

Link to post
Share on other sites

With an LVar the scripts are the only way.

The usual pattern for a 0/1 toggle would be this:
1 (L:O12_006_SW2, Number) - (>L:O12_006_SW2, Number)

and the usual strategy to make more similar scripts in one go would be to keep the editor open, replace the variable name, give the script a new name in the box at the top and pressing "Save as new". This keeps the editor open, and you can just continue replacing the variable name... etc.

LVars are variables, not events, and they can have any numerical value, not just 0/1. And they often do, because most of the time they are used to control the animations in the 3D model. So implementing a hard coded toggle would not work.

Edited by Lorby_SI
  • Like 1


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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online

  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Create New...