Date: Fri, 14 Jan 2005 21:52:46 +0100
authorSam Lantinga <slouken@libsdl.org>
Sun, 29 Jan 2006 08:18:06 +0000
changeset 1283 f214b6fae45a
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
--- a/src/events/SDL_keyboard.c	Sun Jan 29 07:57:13 2006 +0000
+++ b/src/events/SDL_keyboard.c	Sun Jan 29 08:18:06 2006 +0000
@@ -507,7 +507,7 @@
 	/* Drop events that don't change state */
 	if ( SDL_KeyState[keysym->sym] == state ) {
 #if 0
-printf("Event didn't change state - dropped!\n");
+printf("Keyboard event didn't change state - dropped!\n");
 #endif
 		return(0);
 	}
--- a/src/events/SDL_mouse.c	Sun Jan 29 07:57:13 2006 +0000
+++ b/src/events/SDL_mouse.c	Sun Jan 29 08:18:06 2006 +0000
@@ -170,6 +170,14 @@
 		Yrel = Y-SDL_MouseY;
 	}
 
+	/* Drop events that don't change state */
+	if ( ! Xrel && ! Yrel ) {
+#if 0
+printf("Mouse event didn't change state - dropped!\n");
+#endif
+		return(0);
+	}
+
 	/* Update internal mouse state */
 	SDL_ButtonState = buttonstate;
 	SDL_MouseX = X;