Date: Fri, 14 Jan 2005 21:52:46 +0100
authorSam Lantinga <slouken@libsdl.org>
Sun, 29 Jan 2006 08:18:06 +0000
changeset 1283f214b6fae45a
parent 1282 217f5d5a49e5
child 1284 08e3393e9ffb
Date: Fri, 14 Jan 2005 21:52:46 +0100
From: "SkunkGuru"
Subject: [SDL] Repeated mousemotion event on notebook

it seems that every ~500ms something fires a mousemotion event,
but with the same x and y position.
I tryed with both directx and windib video driver.
src/events/SDL_keyboard.c
src/events/SDL_mouse.c
     1.1 --- a/src/events/SDL_keyboard.c	Sun Jan 29 07:57:13 2006 +0000
     1.2 +++ b/src/events/SDL_keyboard.c	Sun Jan 29 08:18:06 2006 +0000
     1.3 @@ -507,7 +507,7 @@
     1.4  	/* Drop events that don't change state */
     1.5  	if ( SDL_KeyState[keysym->sym] == state ) {
     1.6  #if 0
     1.7 -printf("Event didn't change state - dropped!\n");
     1.8 +printf("Keyboard event didn't change state - dropped!\n");
     1.9  #endif
    1.10  		return(0);
    1.11  	}
     2.1 --- a/src/events/SDL_mouse.c	Sun Jan 29 07:57:13 2006 +0000
     2.2 +++ b/src/events/SDL_mouse.c	Sun Jan 29 08:18:06 2006 +0000
     2.3 @@ -170,6 +170,14 @@
     2.4  		Yrel = Y-SDL_MouseY;
     2.5  	}
     2.6  
     2.7 +	/* Drop events that don't change state */
     2.8 +	if ( ! Xrel && ! Yrel ) {
     2.9 +#if 0
    2.10 +printf("Mouse event didn't change state - dropped!\n");
    2.11 +#endif
    2.12 +		return(0);
    2.13 +	}
    2.14 +
    2.15  	/* Update internal mouse state */
    2.16  	SDL_ButtonState = buttonstate;
    2.17  	SDL_MouseX = X;