Melchior FRANZ wrote:
* Josh Babcock -- Wednesday 06 April 2005 04:23:

The Superfort's flaps and gear are electrically powered, and the controls for both are instantaneous switches. ie. you have to hold the switch the whole cycle to keep the motor running. Can anyone think of a way to do this?


Normally, the g key turns on /controls/gear/gear-down, and YASim watches
this property and moves /gear/gear[n]/position-norm accordingly. You just
need to override the g/G key bindings in your *-set.xml file:

    <key n="71">
        <name>G</name>
        <desc>Gear down.</desc>
        <binding>
            <command>nasal</command>
            <script>b29.geardown()</script>
        </binding>
        <mod-up>
            <binding>
                <command>nasal</command>
                <script>b29.gearstop()</script>
            </binding>
        </mod-up>
    </key>

    <key n="103">
        <name>g</name>
        <desc>Gear up.</desc>
        <binding>
            <command>nasal</command>
            <script>b29.gearup()</script>
        </binding>
        <mod-up>
            <binding>
                <command>nasal</command>
                <script>b29.gearstop()</script>
            </binding>
        </mod-up>
    </key>

and likewise for key G] with b29.geardown(). And in your b29.nas, you say 
something
like this:

gear = aircraft.door.new("/controls/gear", 10); # 10 seconds for full move? geardown = func { gear.open() }
gearup = func { gear.close() }
gearstop = func { gear.stop() }


whereby the "stop()" method isn't in CVS yet. You can write 
"gear.move(gear.getpos())"
instead of gear.stop(), until Erik commits the last changes.

And finally, you tell YASim not to do the gear handling itself, but just
to read out the property /controls/gear/position-norm

m.

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Yes but my problem is that I want to catch custom configurations that use a different key or even a joystick button to cycle the gear.


Josh

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to