Allow single joysticks with more than 2 axes to work.
This commit is contained in:
parent
88a0a8264f
commit
0e5ecc165c
1 changed files with 11 additions and 0 deletions
|
@ -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() ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue