1
0
Fork 0

(svn r25318) -Fix: [SDL, FS#5580] Keyboard input stopped working after fullscreen toggle

release/1.4
matthijs 2013-06-04 06:36:59 +00:00
parent 61f7b50480
commit 0d28dc92fc
2 changed files with 9 additions and 3 deletions

View File

@ -340,6 +340,7 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h)
SDL_CALL SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_CALL SDL_QuitSubSystem(SDL_INIT_VIDEO);
SDL_CALL SDL_InitSubSystem(SDL_INIT_VIDEO); SDL_CALL SDL_InitSubSystem(SDL_INIT_VIDEO);
ClaimMousePointer(); ClaimMousePointer();
SetupKeyboard();
} }
} }
/* Remember if we wanted a hwpalette. We can't reliably query /* Remember if we wanted a hwpalette. We can't reliably query
@ -649,15 +650,19 @@ const char *VideoDriver_SDL::Start(const char * const *parm)
DEBUG(driver, 1, "SDL: using driver '%s'", buf); DEBUG(driver, 1, "SDL: using driver '%s'", buf);
MarkWholeScreenDirty(); MarkWholeScreenDirty();
SetupKeyboard();
SDL_CALL SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_CALL SDL_EnableUNICODE(1);
_draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == NULL; _draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == NULL;
return NULL; return NULL;
} }
void VideoDriver_SDL::SetupKeyboard()
{
SDL_CALL SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
SDL_CALL SDL_EnableUNICODE(1);
}
void VideoDriver_SDL::Stop() void VideoDriver_SDL::Stop()
{ {
SdlClose(SDL_INIT_VIDEO); SdlClose(SDL_INIT_VIDEO);

View File

@ -37,6 +37,7 @@ public:
private: private:
int PollEvent(); int PollEvent();
bool CreateMainSurface(uint w, uint h); bool CreateMainSurface(uint w, uint h);
void SetupKeyboard();
}; };
/** Factory for the SDL video driver. */ /** Factory for the SDL video driver. */