summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2014-08-28 19:40:28 -0500
committerTim Angus <tim@ngus.net>2015-03-17 11:38:06 +0000
commit3c0e84cb40fbef18c79185e75b2917b8bce6e8e2 (patch)
treeaa0d25d56ae28c8c3410f1cbee39d3fc6807e403
parent86ad3590d558235f9e5fb7a9ad0072c4bd98787d (diff)
SDL 2 scroll/caps/num lock keys send KEYUP event when key is released
-rw-r--r--src/client/cl_keys.c8
-rw-r--r--src/sdl/sdl_input.c16
2 files changed, 2 insertions, 22 deletions
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index 0fbddd23..52a5f7a2 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -1159,7 +1159,7 @@ void CL_KeyDownEvent( int key, unsigned time )
{
keys[key].down = qtrue;
keys[key].repeats++;
- if( keys[key].repeats == 1 && key != K_SCROLLOCK && key != K_KP_NUMLOCK && key != K_CAPSLOCK )
+ if( keys[key].repeats == 1 )
anykeydown++;
if( keys[K_ALT].down && key == K_ENTER )
@@ -1243,8 +1243,7 @@ void CL_KeyUpEvent( int key, unsigned time )
{
keys[key].repeats = 0;
keys[key].down = qfalse;
- if (key != K_SCROLLOCK && key != K_KP_NUMLOCK && key != K_CAPSLOCK)
- anykeydown--;
+ anykeydown--;
if (anykeydown < 0) {
anykeydown = 0;
@@ -1325,9 +1324,6 @@ void Key_ClearStates (void)
anykeydown = 0;
for ( i=0 ; i < MAX_KEYS ; i++ ) {
- if (i == K_SCROLLOCK || i == K_KP_NUMLOCK || i == K_CAPSLOCK)
- continue;
-
if ( keys[i].down ) {
CL_KeyEvent( i, qfalse, 0 );
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c
index 0ea5d52d..349d3677 100644
--- a/src/sdl/sdl_input.c
+++ b/src/sdl/sdl_input.c
@@ -972,20 +972,6 @@ void IN_Frame( void )
/*
===============
-IN_InitKeyLockStates
-===============
-*/
-void IN_InitKeyLockStates( void )
-{
- const unsigned char *keystate = SDL_GetKeyboardState(NULL);
-
- keys[K_SCROLLOCK].down = keystate[SDL_SCANCODE_SCROLLLOCK];
- keys[K_KP_NUMLOCK].down = keystate[SDL_SCANCODE_NUMLOCKCLEAR];
- keys[K_CAPSLOCK].down = keystate[SDL_SCANCODE_CAPSLOCK];
-}
-
-/*
-===============
IN_Init
===============
*/
@@ -1021,8 +1007,6 @@ void IN_Init( void *windowData )
Cvar_SetValue( "com_unfocused", !( appState & SDL_WINDOW_INPUT_FOCUS ) );
Cvar_SetValue( "com_minimized", appState & SDL_WINDOW_MINIMIZED );
- IN_InitKeyLockStates( );
-
IN_InitJoystick( );
Com_DPrintf( "------------------------------------\n" );
}