From: curt Date: Tue, 28 Sep 1999 22:42:59 +0000 (+0000) Subject: Allow single joysticks with more than 2 axes to work. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0e5ecc165c85f7c47bc616302c289f38f2a35ec2;p=flightgear.git Allow single joysticks with more than 2 axes to work. --- diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index dcad3f78a..ac38aaea2 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -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() ) {