KL Oo

Assigning multiple events to one button switch

Recommended Posts

Hi guys,

 

I've just purchased a new Warthog HOTAS and am loving it. Over the past 2 days I've downloaded LINDA and learnt a lot about assigning events to button presses and am currently utilising the NGX modules provided. Great stuff.

 

What I'd like to know is if its possible to assign two events to occur consecutively upon a single button press. I.e, I want yo assign one button press to firstly enact NGXCDU GND PWR ON and then NGX GRD PWR ON.

 

I;ve tried creating mouse macros with FSUIPC but thats been problematic and I think part of the issue is FSUIPC not being able to pickup certain PMDG events or something.

 

Anyway, is there a way to do this - run two events for one button press.

 

Cheers,

 

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I simply use on press and on release for this in Linda. Works great and easy 

 

pic - LindaConfig

Edited by julian46

Share this post


Link to post
Share on other sites

Welcome to the LINDA community.

You can you the OnPress and OnRelease to assign the 2 sequential functions you wish to call. This is the quickest and easiest method.

Alternatively, you can write you own function containing those functions you wish to call. If you have an aircraft other than FSX Default click on Edit and then Edit User. This opens the user.lua module into the LINDA Editor. Then enter the following code, for example:

  • function myFunction()
  • function1()
  • sleep(50)
  • function2()
  • end

When done click on Save and Reload LUA Engine. 

Assign your new myFunction from the aircraft user mode to your joystick button.

Edited by ScotFlieger
  • Upvote 1

Share this post


Link to post
Share on other sites

Sorry where do we find the built in function() list ?

SOLN:

If you click on "Edit Actions" on the bottom right - it will show a list of all the functions.

The names are the same ones we see in the drop down list when assigning to buttons (with underscore to represent spaces)

eg:

function AB_ALT_plus ()   for "AB ALT plus"

 

Edited by julian46
more information

Share this post


Link to post
Share on other sites

Writing LINDA code requires a little knowledge of programming for you to use the LUA interpreted language. I used function1() and function2() as example function names. You will need to replace these with the names of your desired functions.

To answer your other question. LUA function names can not use spaces so underscores are normally used by us programmers. For readability these are removed when listed.

Edited by ScotFlieger
  • Like 1

Share this post


Link to post
Share on other sites

Thanks so much for your help Scott - Worked a treat. A world of options has opened up!!! I can pre setup my entire aircraft with one button press!

 

Edited by KL Oo

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