Skip to content

Commit

Permalink
Disable key repeat if key catcher is 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed May 19, 2014
1 parent cfcd2d2 commit 6a33a69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/sdl/sdl_input.c
Expand Up @@ -726,6 +726,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 );

Expand Down

0 comments on commit 6a33a69

Please sign in to comment.