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

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.