Dominik Posted May 28, 2022 Report Posted May 28, 2022 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.
John Dowson Posted May 28, 2022 Report Posted May 28, 2022 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
Dominik Posted May 28, 2022 Author Report Posted May 28, 2022 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.
John Dowson Posted May 28, 2022 Report Posted May 28, 2022 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)
Dominik Posted May 28, 2022 Author Report Posted May 28, 2022 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now