src/events/SDL_keyboard.c
changeset 1327 d12a63a8d95a
parent 1312 c9b51268668f
child 1330 450721ad5436
     1.1 --- a/src/events/SDL_keyboard.c	Fri Feb 03 07:43:42 2006 +0000
     1.2 +++ b/src/events/SDL_keyboard.c	Sat Feb 04 08:35:11 2006 +0000
     1.3 @@ -397,6 +397,8 @@
     1.4  	if ( state == SDL_PRESSED ) {
     1.5  		keysym->mod = (SDLMod)modstate;
     1.6  		switch (keysym->sym) {
     1.7 +			case SDLK_UNKNOWN:
     1.8 +				break;
     1.9  			case SDLK_NUMLOCK:
    1.10  				modstate ^= KMOD_NUM;
    1.11  				if ( ! (modstate&KMOD_NUM) )
    1.12 @@ -442,6 +444,8 @@
    1.13  		}
    1.14  	} else {
    1.15  		switch (keysym->sym) {
    1.16 +			case SDLK_UNKNOWN:
    1.17 +				break;
    1.18  			case SDLK_NUMLOCK:
    1.19  			case SDLK_CAPSLOCK:
    1.20  				/* Only send keydown events */
    1.21 @@ -499,18 +503,20 @@
    1.22  			return(0);
    1.23  	}
    1.24  
    1.25 -	/* Drop events that don't change state */
    1.26 -	if ( SDL_KeyState[keysym->sym] == state ) {
    1.27 +	if ( keysym->sym != SDLK_UNKNOWN ) {
    1.28 +		/* Drop events that don't change state */
    1.29 +		if ( SDL_KeyState[keysym->sym] == state ) {
    1.30  #if 0
    1.31  printf("Keyboard event didn't change state - dropped!\n");
    1.32  #endif
    1.33 -		return(0);
    1.34 +			return(0);
    1.35 +		}
    1.36 +
    1.37 +		/* Update internal keyboard state */
    1.38 +		SDL_ModState = (SDLMod)modstate;
    1.39 +		SDL_KeyState[keysym->sym] = state;
    1.40  	}
    1.41  
    1.42 -	/* Update internal keyboard state */
    1.43 -	SDL_ModState = (SDLMod)modstate;
    1.44 -	SDL_KeyState[keysym->sym] = state;
    1.45 -
    1.46  	/* Post the event, if desired */
    1.47  	posted = 0;
    1.48  	if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {