Jump to content
The simFlight Network Forums

Recommended Posts

Posted

With LUA I can write an event e.g.

event.button (2,4,1, "EFIS320") and it works ok.

But how do you check with LUA what position this button is in? Whether it is on or off, what is the position 0,1 or 2

 

Regards

Dominik.

Posted
2 hours ago, Dominik said:

But how do you check with LUA what position this button is in? Whether it is on or off, what is the position 0,1 or 2

You have to determine if there is a simvar (a simulator A type variable, most held in FSUIPC offsets), or an lvar that holds the current which position. Its most probably the latter - try listing lvars to see if there is anything appropriate.  If there is, you can read that in lua.

John

Posted
37 minutes ago, John Dowson said:

You have to determine if there is a simvar (a simulator A type variable, most held in FSUIPC offsets), or an lvar that holds the current which position. Its most probably the latter - try listing lvars to see if there is anything appropriate.  If there is, you can read that in lua.

John

I have a homemade panel. I want lua to read if a given switch is on or off. I don't mean the switch settings in MSFS, but the switches on my panel that I can set in fsuipc.

Posted

You can use the lua com library to read the state of buttons of a HID joystick type device - see the FSUIPC Lua Library documentation, function:
    com.gethidbuttons(handle, str)

 

Posted
3 minutes ago, John Dowson said:

You can use the lua com library to read the state of buttons of a HID joystick type device - see the FSUIPC Lua Library documentation, function:
    com.gethidbuttons(handle, str)

 

Thank you for your help!

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.