English Rebel Posted June 25, 2013 Report Posted June 25, 2013 I'm just getting started with Lua scripts so please excuse my lack of knowledge. :neutral: I have read through the FSUIPC Lua Library document and noticed that virtual joystick buttons cannot be used to trigger an action such as playing a .WAV file (e.g. event.button(joynum, button, "function-name"). Is there no other way to detect a virtual joystick button to do this such as ipc.read? I have buttons for which there are no offsets so virtual buttons are my only option. Thanks Alan
Pete Dowson Posted June 25, 2013 Report Posted June 25, 2013 I'm just getting started with Lua scripts so please excuse my lack of knowledge. :neutral: I have read through the FSUIPC Lua Library document and noticed that virtual joystick buttons cannot be used to trigger an action such as playing a .WAV file (e.g. event.button(joynum, button, "function-name"). Is there no other way to detect a virtual joystick button to do this such as ipc.read? I have buttons for which there are no offsets so virtual buttons are my only option. Joystick button trapping involves calls to Direct Input. Virtual buttons are just bits in offsets. So, just use an event.offset to detect them and trigger your function. Each byte contains 8 virtual buttons, so use "logic.And" in the function to test the relevant bit. It's no harder, rea;;y/ Just an extra line (well, plus another 'end').. Pete
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