changeset 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 217f5d5a49e5
children 08e3393e9ffb
files src/events/SDL_keyboard.c src/events/SDL_mouse.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;