joystick: Linux joysticks now recover better from dropped events.

Fixes Bugzilla #4830.
This commit is contained in:
Ryan C. Gordon
2020-06-28 16:23:05 -04:00
parent e594a6738a
commit 0e98040d43
3 changed files with 64 additions and 5 deletions

View File

@@ -167,6 +167,14 @@ loop(void *arg)
event.jbutton.which, event.jbutton.button);
break;
case SDL_KEYDOWN:
/* Press the L key to lag for 3 seconds, to see what happens
when SDL doesn't service the event loop quickly. */
if (event.key.keysym.sym == SDLK_l) {
SDL_Log("Lagging for 3 seconds...\n");
SDL_Delay(3000);
break;
}
if ((event.key.keysym.sym != SDLK_ESCAPE) &&
(event.key.keysym.sym != SDLK_AC_BACK)) {
break;