diff --git a/src/Input/FGEventInput.cxx b/src/Input/FGEventInput.cxx index 91528c23f..5c4899073 100644 --- a/src/Input/FGEventInput.cxx +++ b/src/Input/FGEventInput.cxx @@ -190,7 +190,7 @@ void FGAxisEvent::fire( FGEventData & eventData ) ed.value = interpolater->interpolate(ed.value); } } - + FGInputEvent::fire( ed ); } @@ -242,6 +242,15 @@ void FGButtonEvent::fire( FGEventData & eventData ) lastState = pressed; } +void FGButtonEvent::update( double dt ) +{ + if (repeatable && lastState) { + // interval / dt handling is done by base ::fire method + FGEventData ed{1.0, dt, 0 /* modifiers */}; + FGInputEvent::fire( ed ); + } +} + FGInputDevice::~FGInputDevice() { FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal"); diff --git a/src/Input/FGEventInput.hxx b/src/Input/FGEventInput.hxx index d2990e22a..b07662f08 100644 --- a/src/Input/FGEventInput.hxx +++ b/src/Input/FGEventInput.hxx @@ -175,6 +175,7 @@ public: FGButtonEvent( FGInputDevice * device, SGPropertyNode_ptr node ); virtual void fire( FGEventData & eventData ); + void update( double dt ) override; protected: bool repeatable; bool lastState;