Skip to content

Commit

Permalink
Date: Fri, 14 Jan 2005 21:52:46 +0100
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Jan 29, 2006
1 parent 925f293 commit a8f3ffa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/SDL_keyboard.c
Expand Up @@ -507,7 +507,7 @@ printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym),
/* 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);
}
Expand Down
8 changes: 8 additions & 0 deletions src/events/SDL_mouse.c
Expand Up @@ -170,6 +170,14 @@ int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y)
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;
Expand Down

0 comments on commit a8f3ffa

Please sign in to comment.