diff src/events/SDL_mouse.c @ 1283:f214b6fae45a

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.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Jan 2006 08:18:06 +0000
parents 28ac87a38c17
children c9b51268668f
line wrap: on
line diff
--- 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;