This is a somewhat similar bug like that in the previous commit, but
in this case only one event was processed for each screen update,
causing many events (like those produced from analog sticks that are
moved while the keyboard is about to be configured) to be processed
one after the other, each with a full video frame delay in between.
The fix works just like that used when configuring game controllers.
while (!finished)
{
Event event;
+ unsigned int event_frame_delay = 0;
+ unsigned int event_frame_delay_value = GAME_FRAME_DELAY;
- if (NextValidEvent(&event))
+ // reset frame delay counter directly after updating screen
+ ResetDelayCounter(&event_frame_delay);
+
+ while (NextValidEvent(&event))
{
switch (event.type)
{
HandleOtherEvents(&event);
break;
}
+
+ // do not handle events for longer than standard frame delay period
+ if (DelayReached(&event_frame_delay, event_frame_delay_value))
+ break;
}
BackToFront();