From 0e5ecc165c85f7c47bc616302c289f38f2a35ec2 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 28 Sep 1999 22:42:59 +0000 Subject: [PATCH] Allow single joysticks with more than 2 axes to work. --- src/Joystick/joystick.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() ) { -- 2.39.5