Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Programming a toggle switch

Featured Replies

Hi, I thought it would be simple to program a toggle switch, press it to turn on windshield heat, press it again to turn it off. But I've tried both button and axes and I can get it to activate when I push down the button, but it deactivates when I release the button. Not sure what I'm doing wrong. Here's a screenshot: https://gyazo.com/0aaa6fb29ee18386dd5320352fa5371d

any help would be appreciated.

Kat

  • Commercial Member

That is not how this works in AAO, the app doesn't have a built-in toggle feature. 

This toggle must be scripted. In case of this LVar, the RPN code will probably look like this:

1 (L:var_windshieldHeatSwitch, Number) - (>L:var_windshieldHeatSwitch, Number)

Every time this script is called, the value of the LVar changes from 0 to 1 and 1 to 0 respectively.
Create the script in a group of your choice, then assign it to the Key Down only. Key up is empty.

Edited by Lorby_SI

LORBY-SI

  • Author

Thanks! I haven't created a script before, so I will read the documentation on how to do that. But, don't be surprised if I'm back eventually. Hopefully, as I spend more time with AAO, I'll have less questions.

Kat

  • Commercial Member
1 hour ago, katchaplin said:

Thanks! I haven't created a script before, so I will read the documentation on how to do that. But, don't be surprised if I'm back eventually. Hopefully, as I spend more time with AAO, I'll have less questions.

Kat

  1. Make sure that AAO is connected to the sim and that you are sitting in the cockpit
  2. Open "Scripting->Script Editor"
  3. Copy and paste my code above into the big white box
  4. Use the "Test" button to see if it works
  5. Enter a "Title" for the script at the top and select a group, for example "Scripts". (you can create your own groups with the "Manage Script Groups" button.
  6. Press "Save as new"
  7. Open your button definition
  8. Delete the Key Up
  9. Open the Key Down selection, scroll down to the group that you've selected for the script, open the group, doubleclick on the title of your script

 

LORBY-SI

  • Author

Hi,

I appreciate the instructions, now I have a script, yay! and I know how to do them, double yay!. But it still has the same issue. When I depress the button, the Windshield Heat activates, when I release the button it deactivates, rather than acting as a toggle.

https://gyazo.com/9dcc0109fdbe315cf5df64945b6efb8e

Kat

Disregard, I still had the old button assignment. It works great now, thanks so much!!!

Edited by katchaplin
new information

Short press on. Long press off is how I handle push button for toggle. Right or wrong. 🙂

  • Commercial Member
2 hours ago, Adrian123 said:

Short press on. Long press off is how I handle push button for toggle. Right or wrong. 🙂

? Not sure if that depends on short and long click?

There are about a dozen ways that something can be a toggle or at least operated as a toggle. That depends entirely on what the aircraft developer has implemented for that particular knob, button or lever in the cockpit.

And there aren't only two-way toggles, there are many instances where people want to switch through more than two states with one momentary button (=cockpit switches with three or more positions). All this can be scripted in AAO, but it will look differently for every single use case. 

This "toggle" theme is the standard use case for all StreamDeck profiles, as the device only has momentary buttons. If you are looking for scripts for a certain aircraft, searching for a StreamDeck profile on flightsim.to is the best starting point. These profiles usually have a separate script file containing all those "toggles" that can be imported separately into AAO. (=you don't need to actually have a StreamDeck to use the scripts!)

Edited by Lorby_SI

LORBY-SI

That's how I handle it with Xtouch anyway. Should have mention that.

I also utilize the 'long click, 1000ms' function for many off items, as it allows me to really think about what I'm turning off in case I'm about to make a mistake, ie autopilot needs a long click for off, as does run switches etc. Labeled with a small square next to the item on the xtouch overlay helps to remind which function requires it.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.