Fixed bug #322
Need to resync the keyboard state every time we set a video mode, since the code in SDL_video.c is clearing the keyboard state. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402426
This commit is contained in:
parent
432dd128e4
commit
4722d6e917
1 changed files with 28 additions and 27 deletions
|
@ -1078,33 +1078,6 @@ static int X11_CreateWindow(_THIS, SDL_Surface *screen,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the internal keyboard state */
|
|
||||||
X11_SetKeyboardState(SDL_Display, NULL);
|
|
||||||
|
|
||||||
/* When the window is first mapped, ignore non-modifier keys */
|
|
||||||
{
|
|
||||||
Uint8 *keys = SDL_GetKeyState(NULL);
|
|
||||||
for ( i = 0; i < SDLK_LAST; ++i ) {
|
|
||||||
switch (i) {
|
|
||||||
case SDLK_NUMLOCK:
|
|
||||||
case SDLK_CAPSLOCK:
|
|
||||||
case SDLK_LCTRL:
|
|
||||||
case SDLK_RCTRL:
|
|
||||||
case SDLK_LSHIFT:
|
|
||||||
case SDLK_RSHIFT:
|
|
||||||
case SDLK_LALT:
|
|
||||||
case SDLK_RALT:
|
|
||||||
case SDLK_LMETA:
|
|
||||||
case SDLK_RMETA:
|
|
||||||
case SDLK_MODE:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
keys[i] = SDL_RELEASED;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Map them both and go fullscreen, if requested */
|
/* Map them both and go fullscreen, if requested */
|
||||||
if ( ! SDL_windowid ) {
|
if ( ! SDL_windowid ) {
|
||||||
XMapWindow(SDL_Display, SDL_Window);
|
XMapWindow(SDL_Display, SDL_Window);
|
||||||
|
@ -1185,6 +1158,34 @@ SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update the internal keyboard state */
|
||||||
|
X11_SetKeyboardState(SDL_Display, NULL);
|
||||||
|
|
||||||
|
/* When the window is first mapped, ignore non-modifier keys */
|
||||||
|
if ( !current->w && !current->h ) {
|
||||||
|
Uint8 *keys = SDL_GetKeyState(NULL);
|
||||||
|
int i;
|
||||||
|
for ( i = 0; i < SDLK_LAST; ++i ) {
|
||||||
|
switch (i) {
|
||||||
|
case SDLK_NUMLOCK:
|
||||||
|
case SDLK_CAPSLOCK:
|
||||||
|
case SDLK_LCTRL:
|
||||||
|
case SDLK_RCTRL:
|
||||||
|
case SDLK_LSHIFT:
|
||||||
|
case SDLK_RSHIFT:
|
||||||
|
case SDLK_LALT:
|
||||||
|
case SDLK_RALT:
|
||||||
|
case SDLK_LMETA:
|
||||||
|
case SDLK_RMETA:
|
||||||
|
case SDLK_MODE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
keys[i] = SDL_RELEASED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up the new mode framebuffer */
|
/* Set up the new mode framebuffer */
|
||||||
if ( ((current->w != width) || (current->h != height)) ||
|
if ( ((current->w != width) || (current->h != height)) ||
|
||||||
((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {
|
((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue