Jump to content
The simFlight Network Forums
akis.papapantelis

Disable Specific Joystick with Lua

Recommended Posts

Hello,

I have 2 flight sticks (joysticks) in my sim setup. I want  to disable/enable the second of them using a button on the first. Is there a way to do this with lua? Mainly I want to disable/enable elevator and aileron input from the second joystick.

Thank you,

Akis

Share this post


Link to post
Share on other sites

Hi Akis,

to do this, you would have to use your lua script to receive the axis values and send on the axis controls.

What you need is a lua script to receive your axis values and then send the controls depending upon the state of a flag, also controlled using your button. In your Axis Assignment tab, you need to assign your axis to 'Send to FS as normal axis', and then select the 'LuaValue <your script name>' option. This will send the axis value to a lua variable called ipcPARAM, which you can then optionally use to send the control to the sim, depending upon the state of your button. The lua script should be auto-started (i.e. add it to the '[Auto]' section of your ini. Check the documentation for 'event.param' on page 29 of the Lua Library documentation.

Not sure why you would want to do this though....

Cheers,

John

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.