diff src/modules/window/sdl/Window.cpp @ 1198:4fede85debc1

Reapply sdl's keyrepeat settings after setWindow
author Bart van Strien <bart.bes+projects@gmail.com>
date Mon, 28 Jan 2013 00:25:03 +0100
parents 86a44f2bc38f
children 8c3108ab0e95
line wrap: on
line diff
--- a/src/modules/window/sdl/Window.cpp	Wed Oct 17 21:33:10 2012 -0400
+++ b/src/modules/window/sdl/Window.cpp	Mon Jan 28 00:25:03 2013 +0100
@@ -63,6 +63,8 @@
 bool Window::setWindow(int width, int height, bool fullscreen, bool vsync, int fsaa)
 {
 	bool mouseVisible = getMouseVisible();
+	int keyrepeatDelay, keyrepeatInterval;
+	SDL_GetKeyRepeat(&keyrepeatDelay, &keyrepeatInterval);
 
 	// We need to restart the subsystem for two reasons:
 	// 1) Special case for fullscreen -> windowed. Windows XP did not
@@ -87,6 +89,7 @@
 	// Set caption.
 	setWindowTitle(windowTitle);
 	setMouseVisible(mouseVisible);
+	SDL_EnableKeyRepeat(keyrepeatDelay, keyrepeatInterval);
 
 	// Set GL attributes
 	SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);