FG 2018.1 revised joystick

20 Feb 2018 10:35 #37810 by Richard
As part of 2018.1 I've changed the joystick dialog so that it uses the an axis binding for the throttles - which will allow for this axis to be inverted.

Unfortunately this will break any craft that override controls.throttleAxis, controls.mixtureAxis or controls.propellerAxis. (it was probably always a bad idea to do this but some models have done this)

so if your code does something like this
controls.throttleAxis = func {
    var val = cmdarg().getNode("setting").getValue();
    if(size(arg) > 0) { val = -val; }

    var position = (1 - val)/2;

    # throttle doesn't disturb autothrottle
    if( getprop("/autopilot/locks/speed") == "" ) {
        props.setAll("/controls/engines/engine", "throttle", position);
    }

    props.setAll("/controls/engines/engine", "throttle-manual", position);
}

add some new code that does this.
# 2018.2 introduces new "all" properties for throttle, mixture and prop pitch.
# this is the correct way to interface with the axis based controls - use a listener
# on the *-all property

_setlistener("/controls/engines/throttle-all", func{
    var position = (1 - getprop("/controls/engines/throttle-all")) / 2;

    # throttle doesn't disturb autothrottle
    if( getprop("/autopilot/locks/speed") == "" ) {
        props.setAll("/controls/engines/engine", "throttle", position);
    }

    props.setAll("/controls/engines/engine", "throttle-manual", position);
},0,0);

This is what the new configuration dialog looks like. I've also had to remove the dropdowns and replace with a popup dialog that has the same functionality.

The following user(s) said Thank You: Algernon, StuartC, Vodoun da Vinci, geed, timi

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds
Powered by Kunena Forum

PM Mailbox

You are not logged in.

Forum Search

Keyword