Mouse bug with Win32/OpenGL/SDL and pressed som key

Hello,

we think, that we have found an error in getting mouse position in Win32
applications, running OpenGL and SDL.

Sample app with source code can be downloaded from
www.freex.sk/sdl/sdl_mouse_problem.rar This sample app is minimal implemetation
we have made to show this error.

When yor run the app, and move mouse, circle in window will move. It’s
OK. But when you press some key on keyboard, for example “e”, the mouse
will move in skips.

It’s because when we get relative mouse position through
SDL_GetRelativeMouseState() - with pressed key “e” on keyboard, the
relative positons will skip from small numbers to high numbers, for
example: 3, 3, 3, 90 in each frame. Try it. In console windows we are
logging this numbers, so you can see.

This problem doesn’t exist, when SDL_ShowCursor(SDL_ENABLE). But we
want do hide default mouse cursor.

This problem exists in windowed and fullscreen apps too.

This problem occures only in small FPS, or when there is a lot of
rendering. I tried to simulate this by SDL_Delay(100) in main loop.
But in our main application, it’s slowed by rendering code, so this is
only simulation of real delaying.

Tested on:
Windows 2000, SP2
Visual C++ 6.0 SP5
SDL 1.2.4, downloaded 8/31/2002

Thanks for any help,
Marek Rosa