diff -Naur SDL-1.2.15/src/video/x11/SDL_x11events.c SDL-1.2.15.patched/src/video/x11/SDL_x11events.c --- SDL-1.2.15/src/video/x11/SDL_x11events.c 2025-05-03 05:04:34.839375088 -0400 +++ SDL-1.2.15.patched/src/video/x11/SDL_x11events.c 2025-05-03 17:27:15.334181528 -0400 @@ -385,6 +385,9 @@ return(posted); } +static XEvent deferred_xevent; +static int defer_xevent_until = 0; + static int X11_DispatchEvent(_THIS) { int posted; @@ -411,6 +414,22 @@ } #endif + if(xevent.type == KeyRelease && xevent.xkey.keycode == 0x24) { + /* we just got a Return keyrelease */ + if(!defer_xevent_until) { + /* a real one - defer it */ + deferred_xevent = xevent; + defer_xevent_until = (SDL_GetTicks() + 30); + return 0; + } else if(SDL_GetTicks() < defer_xevent_until) { + /* a deferred event whose time has not yet come */ + return 0; + } else { + /* process normally */ + defer_xevent_until = 0; + } + } + posted = 0; switch (xevent.type) { @@ -936,6 +955,12 @@ X11_DispatchEvent(this); ++pending; } + + if(defer_xevent_until) { + pending--; + XPutBackEvent(SDL_Display, &deferred_xevent); + } + if ( switch_waiting ) { Uint32 now;