From c3d4d0aa93f114b1d3ec92312d1c1f4e6e929e0d Mon Sep 17 00:00:00 2001
From: Zack Middleton <zturtleman@gmail.com>
Date: Mon, 19 May 2014 03:37:59 -0500
Subject: Disable key repeat if key catcher is 0

SDL1.2 branch disables key repeat when key catcher is 0.
Presumably to prevent binds from executing multiple times.

SDL2 replaced being able to disabled key repeat using SDL_EnableKeyRepeat
with a non-zero repeat value in the key event.
---
 src/sdl/sdl_input.c | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/sdl')

diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c
index 19fbcaae..65bf0815 100644
--- a/src/sdl/sdl_input.c
+++ b/src/sdl/sdl_input.c
@@ -775,6 +775,9 @@ static void IN_ProcessEvents( void )
 		switch( e.type )
 		{
 			case SDL_KEYDOWN:
+				if ( e.key.repeat && Key_GetCatcher( ) == 0 )
+					break;
+
 				if( ( key = IN_TranslateSDLToQ3Key( &e.key.keysym, qtrue ) ) )
 					Com_QueueEvent( 0, SE_KEY, key, qtrue, 0, NULL );
 
-- 
cgit