Changeset - r20308:7cc954e96245
[Not reviewed]
master
0 2 0
matthijs - 11 years ago 2013-06-04 06:36:59
matthijs@openttd.org
(svn r25318) -Fix: [SDL, FS#5580] Keyboard input stopped working after fullscreen toggle
2 files changed with 9 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/video/sdl_v.cpp
Show inline comments
 
@@ -340,6 +340,7 @@ bool VideoDriver_SDL::CreateMainSurface(
 
			SDL_CALL SDL_QuitSubSystem(SDL_INIT_VIDEO);
 
			SDL_CALL SDL_InitSubSystem(SDL_INIT_VIDEO);
 
			ClaimMousePointer();
 
			SetupKeyboard();
 
		}
 
	}
 
	/* Remember if we wanted a hwpalette. We can't reliably query
 
@@ -649,15 +650,19 @@ const char *VideoDriver_SDL::Start(const
 
	DEBUG(driver, 1, "SDL: using driver '%s'", buf);
 

	
 
	MarkWholeScreenDirty();
 

	
 
	SDL_CALL SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
	SDL_CALL SDL_EnableUNICODE(1);
 
	SetupKeyboard();
 

	
 
	_draw_threaded = GetDriverParam(parm, "no_threads") == NULL && GetDriverParam(parm, "no_thread") == 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()
 
{
 
	SdlClose(SDL_INIT_VIDEO);
src/video/sdl_v.h
Show inline comments
 
@@ -37,6 +37,7 @@ public:
 
private:
 
	int PollEvent();
 
	bool CreateMainSurface(uint w, uint h);
 
	void SetupKeyboard();
 
};
 

	
 
/** Factory for the SDL video driver. */
0 comments (0 inline, 0 general)