Commit 8105c7de authored by Sam Lantinga's avatar Sam Lantinga

Fixed key repeat interactions with event filters (thanks Elmar!)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40224
parent ad1ac005
...@@ -514,16 +514,16 @@ printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym), ...@@ -514,16 +514,16 @@ printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym),
if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
event.key.state = state; event.key.state = state;
event.key.keysym = *keysym; event.key.keysym = *keysym;
/*
* jk 991215 - Added
*/
if (repeatable && (SDL_KeyRepeat.delay != 0)) {
SDL_KeyRepeat.evt = event;
SDL_KeyRepeat.firsttime = 1;
SDL_KeyRepeat.timestamp=SDL_GetTicks();
}
if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) { if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) {
posted = 1; posted = 1;
/*
* jk 991215 - Added
*/
if (repeatable && (SDL_KeyRepeat.delay != 0)) {
SDL_KeyRepeat.evt = event;
SDL_KeyRepeat.firsttime = 1;
SDL_KeyRepeat.timestamp=SDL_GetTicks();
}
SDL_PushEvent(&event); SDL_PushEvent(&event);
} }
} }
...@@ -548,7 +548,9 @@ void SDL_CheckKeyRepeat(void) ...@@ -548,7 +548,9 @@ void SDL_CheckKeyRepeat(void)
} else { } else {
if ( interval > (Uint32)SDL_KeyRepeat.interval ) { if ( interval > (Uint32)SDL_KeyRepeat.interval ) {
SDL_KeyRepeat.timestamp = now; SDL_KeyRepeat.timestamp = now;
SDL_PushEvent(&SDL_KeyRepeat.evt); if ( (SDL_EventOK == NULL) || SDL_EventOK(&SDL_KeyRepeat.evt) ) {
SDL_PushEvent(&SDL_KeyRepeat.evt);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment