[SDL] Repeated mousemotion event on notebook

SkunkGuru skunkguru at hotmail.com
Fri Jan 14 12:52:46 PST 2005


I have a strange problem with my notebook.
Win2000 prof. - latest SDL (from devel. zip)

this is the sample code (compiled with VC6):

#include "sdl.h"
int main(int argc, char *argv[])
{
   if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
      printf("SDL_Init %s", SDL_GetError());
   }
   SDL_Surface* Surface = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE);
   if(Surface == NULL) {
      printf("SDL_SetVideoMode %s", SDL_GetError());
   }
   SDL_Event event;
   bool done = false;
   while (!done) {

      while(SDL_PollEvent(&event)) {
         if(event.type == SDL_QUIT) {
            done = true;
         }
         if(event.type == SDL_KEYDOWN) {
            if(event.key.keysym.sym == SDLK_ESCAPE) {
               done = true;
            }
         }
         if(event.type == SDL_MOUSEMOTION) {
            printf("%i : %i %i\n", SDL_GetTicks(), event.button.x,
event.button.y);
         }
      }
   }
   SDL_Quit();
   return 0;
}

If I run this program for a few second (without moving the mouse),
I find that my stdout.txt file contains something like this:
331 : 366 240
331 : 366 240
806 : 366 240
1306 : 366 240
1802 : 366 240
2302 : 366 240
2809 : 366 240
3308 : 366 240
3813 : 366 240
4312 : 366 240

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.

This doesn't happen on my desktop PC, so I think is something
notebook-related, maybe because the mouse is not a "real" mouse... ?

I know I can solve this problem testing the x and y with the previous,
but I'd like to know if it's a problem of my notebook (IBM Thinkpad)
or if it's something more...

-- 
Skunk.




More information about the SDL mailing list