Jump to content
The simFlight Network Forums

Dynamic axis assignment


Recommended Posts

Hi,

I'd like to have a joystick axis reassigned on button press, e. g. if a joystick axis is assigned to the aileron axis, I want to press a button to reassign the same axis to act as steering tiller axis, and pressing the button again (or a different button) should switch back to the aileron axis assignment.

Is such thing possible?

If yes, I'd appreciate any input on how to actually solve this.

Thank you very much

Dave

Link to comment
Share on other sites

  • 2 weeks later...

I'd like to have a joystick axis reassigned on button press, e. g. if a joystick axis is assigned to the aileron axis, I want to press a button to reassign the same axis to act as steering tiller axis, and pressing the button again (or a different button) should switch back to the aileron axis assignment.

Is such thing possible?

Yes. You'd have to put that logic into a Lua plug-in. The axis would be assigned to that Lua plug-in, which would automatically receive the raw uncalibrated axis input as variable "ipcPARAM". In the plug-in you would test a user offset to see how to forward the axis using ipc.control. The best control values to use are the "direct to FSUIPC calibration" ones, lists at the end of the added controls list in the FSUIPC advanced user's guide.

The user offset (eg 66C0) would be updated by your button using offset byte cyclic inc, so the value there cycles between however many values you want, or if only the two, use offset byte togglebits with a value of 255 so it alternates between 0 and 255,

Regards

Pete

Link to comment
Share on other sites

Yes. You'd have to put that logic into a Lua plug-in. The axis would be assigned to that Lua plug-in, which would automatically receive the raw uncalibrated axis input as variable "ipcPARAM". In the plug-in you would test a user offset to see how to forward the axis using ipc.control. The best control values to use are the "direct to FSUIPC calibration" ones, lists at the end of the added controls list in the FSUIPC advanced user's guide.

The user offset (eg 66C0) would be updated by your button using offset byte cyclic inc, so the value there cycles between however many values you want, or if only the two, use offset byte togglebits with a value of 255 so it alternates between 0 and 255,

Regards

Pete

Thanks. You really work through your posts backlog and provide help and answers. I do appreciate that.

Link to comment
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...
 Share

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