]> git.mxchange.org Git - flightgear.git/commitdiff
Allow single joysticks with more than 2 axes to work.
authorcurt <curt>
Tue, 28 Sep 1999 22:42:59 +0000 (22:42 +0000)
committercurt <curt>
Tue, 28 Sep 1999 22:42:59 +0000 (22:42 +0000)
src/Joystick/joystick.cxx

index dcad3f78acd11e217ba9f44353749b54821a7d07..ac38aaea27033c41fbbf583b8dec459e3273fca4 100644 (file)
@@ -185,6 +185,17 @@ int fgJoystickRead( void ) {
        js0->read( &b, js_ax0 ) ;
        controls.set_aileron( js_ax0[0] );
        controls.set_elevator( -js_ax0[1] );
+
+       //  Added by William Riley -- riley@technologist.com
+       if ( js0->getNumAxes() >= 3 ) {
+           controls.set_throttle( FGControls::ALL_ENGINES,
+                                  ((-js_ax0[2] + 1) / 2) );
+       } 
+       if ( js0->getNumAxes() > 3 ) {
+           controls.set_rudder( js_ax0[3] );
+       }
+       //  End of William's code
+
     }
 
     if ( ! js1->notWorking() ) {