Fixed key repeat interactions with event filters (thanks Elmar!)
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40224
This commit is contained in:
parent
ad1ac00522
commit
8105c7de87
1 changed files with 11 additions and 9 deletions
|
@ -514,8 +514,6 @@ 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;
|
||||||
if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) {
|
|
||||||
posted = 1;
|
|
||||||
/*
|
/*
|
||||||
* jk 991215 - Added
|
* jk 991215 - Added
|
||||||
*/
|
*/
|
||||||
|
@ -524,6 +522,8 @@ printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym),
|
||||||
SDL_KeyRepeat.firsttime = 1;
|
SDL_KeyRepeat.firsttime = 1;
|
||||||
SDL_KeyRepeat.timestamp=SDL_GetTicks();
|
SDL_KeyRepeat.timestamp=SDL_GetTicks();
|
||||||
}
|
}
|
||||||
|
if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) {
|
||||||
|
posted = 1;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -548,11 +548,13 @@ 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;
|
||||||
|
if ( (SDL_EventOK == NULL) || SDL_EventOK(&SDL_KeyRepeat.evt) ) {
|
||||||
SDL_PushEvent(&SDL_KeyRepeat.evt);
|
SDL_PushEvent(&SDL_KeyRepeat.evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int SDL_EnableKeyRepeat(int delay, int interval)
|
int SDL_EnableKeyRepeat(int delay, int interval)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue