Hi,
I'm having trouble with mouse motion events using SDL 1.2.13 on Ubuntu Linux 9.10, x64 version. I'm getting mouse motion events with inexplicably large values for apparently no reason.
The part of the code grabbing events looks as follows:
while(!m_game_over)
{
SDL_Event e;
while(SDL_PollEvent(&e))
{
switch(e.type)
{
//...snip...
case SDL_MOUSEMOTION:
m_log << "(" << e.motion.xrel << "," << e.motion.yrel << ")\n";
break;
//..snip..
}
}
draw_stuff();
SDL_Delay(1);
}
Running this code, if I slowly move the mouse left across the screen, the log is filled with the following:
(-9,-1)
(-7,0)
(-2,0)
(-1,0)
(521,471)
(521,471)
(521,471)
(-3,1)
(-2,1)
(521,471)
(-1,2)
(-2,0)
(-1,1)
(-2,0)
(0,2)
(-1,1)
(521,471)
(-2,0)
(521,471)
(-1,0)
(-2,0)
(-1,0)
(-2,0)
(521,471)
(-1,0)
(-5,0)
(-3,0)
(-4,0)
(-5,0)
(-3,0)
(-1,0)
(-3,0)
(-2,0)
(521,471)
(521,471)
(-3,0)
(-3,0)
(-3,0)
(-4,0)
(-5,0)
(-4,0)
(-5,0)
(-3,0)
(-3,0)
and I'm not sure why. Has anyone else run into this before? Right now I can sort of deal with it by making sure that xrel and yrel are between -100 and 100, but I'd prefer to fix the problem rather than build a hack to deal with it.