Jump to content
The simFlight Network Forums

lua manager for overloading a button

Blake Buhlig

Recommended Posts

I wanted something like TripleUse.lua to overload the trigger button on my Alpha, but not finding that it or anything else I ran across did what I wanted, I wrote my own.


The basic supported pattern is a train of consecutive button clicks,
and a variant is the train of clicks except with the final click
continuing to be held down. Different actions are signaled by changing the
length of consecutive clicks or click-and-holds. For example, the actions on
the overloaded button as noted below left, could trigger the corresponding
actions below right.

- single click and release : reset view
- single click and hold    : transmit voice while held
- double click and release : toggle view zoom
- double click and hold    : enable 2nd use of other buttons while held
- triple click and release : toggle internal/external view
- triple click and hold    : enable 3rd use of other buttons while held

Each click and release sequence toggles a different virtual button, to which
you can assign in the INI file like any physical button. Similarly each click
and hold sequence will press a virtual button during the hold and will
release the virtual button once the overloaded joystick button is released.

Upon detecting a particular sequence, the module will play a short audio
WAV file as feedback to you about what it detected. As an example, in my setup
I generated generate morse code WAV files from
per the below table, so that the dit's and dah's correspond to the
sequence of clicks and holds. 

Letter    Morse Code   Representing
 ===      =====        ======================
  E       .            single click
  T       -            single click-and-hold
  I       ..           double click
  A       .-           double click-and-hold
  S       ...          triple click
  U       ..-          triple click-and-hold
  H       ....         4x click
  V       ...-         4x click-and-hold
  5       .....        5x click
  4       ....-        5x click-and-hold

Then, one final sound: the WAV file "ovrldbtn.wav" is played on startup of the
framework, as an indicator the framework is ready and as a test of the sound
system. For my 'ovrldbtn.wav', I used the aforementioned website to generate a
morse code WAV file that plays the word "ready".
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.