diff --git a/src/Input/FGJoystickInput.cxx b/src/Input/FGJoystickInput.cxx index 1144fca99..979664c55 100644 --- a/src/Input/FGJoystickInput.cxx +++ b/src/Input/FGJoystickInput.cxx @@ -344,7 +344,11 @@ void FGJoystickInput::updateJoystick(int index, FGJoystickInput::joystick* joy, if (js == 0 || js->notWorking()) { joysticks[index].initializing = true; if (js) { - joysticks[index].plibJS.reset( new jsJoystick(index) ); + joysticks[index].init_dt += dt; + if (joysticks[index].init_dt >= 1.0) { + joysticks[index].plibJS.reset( new jsJoystick(index) ); + joysticks[index].init_dt = 0.0; + } } return; } diff --git a/src/Input/FGJoystickInput.hxx b/src/Input/FGJoystickInput.hxx index 247225575..c2d6239b5 100644 --- a/src/Input/FGJoystickInput.hxx +++ b/src/Input/FGJoystickInput.hxx @@ -104,6 +104,7 @@ private: bool initializing = true; bool initialized = false; float values[MAX_JOYSTICK_AXES]; + double init_dt = 0.0f; void clearAxesAndButtons(); };