Incorrect mouse motion

I am new to SDL.

I am experiencing a problem with the absolute mouse position in win2k, I am
working in openGL. I am processing the SDL_MOUSEMOTION message. When I
move the mouse slowly, the coords track correctly, but when I move the mouse
quickly from left to right they are off by up to 500 pixels by the time I
reach the right side of the screen. If I then again move the mouse slowly,
I still do not get the proper coords indicating that it is not a case of my
event polling loop not keeping up with the mouse. Any ideas?

    case SDL_MOUSEMOTION:
        if ( dragActive )
        {
            dx = event.motion.xrel;
            dy = event.motion.yrel;
        } else
        {
            mx = event.motion.x;
            my = event.motion.y;
        }
        break;

John

I am new to SDL.

I am experiencing a problem with the absolute mouse position in win2k, I am
working in openGL. I am processing the SDL_MOUSEMOTION message. When I
move the mouse slowly, the coords track correctly, but when I move the mouse
quickly from left to right they are off by up to 500 pixels by the time I
reach the right side of the screen. If I then again move the mouse slowly,
I still do not get the proper coords indicating that it is not a case of my
event polling loop not keeping up with the mouse. Any ideas?

It’s a bug that I haven’t been able to solve. It appears to be something
involved with the mouse driver in Windows, but I have no idea why it would
happen only in OpenGL mode.

Any ideas anyone?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

i think that SDL have some troubles with mouse uder win32

Hi

All I can add is that I tried and failed to resolve this.

We ended up using our app in pseudo full screen mode (A 1024 x 768 window
with SDL_NOFRAME specified and the Windows taskbar not set to be always on
top).

The exact problem is that the mouse co-ordinates behave as if the screen
resolution is 640 x 480 when using OpenGL in fullscreen mode. The 640 x 480
"window" then pans around to follow the cursor!

I believe this question has been asked quite a few times in the past with no
satisfactory resolution.

Regards,

Steve> ----- Original Message -----

From: Sam Lantinga [mailto:slouken@devolution.com]
Sent: 28 March 2002 16:22
To: sdl at libsdl.org
Subject: Re: [SDL] Incorrect mouse motion…

I am new to SDL.

I am experiencing a problem with the absolute mouse position in win2k, I
am
working in openGL. I am processing the SDL_MOUSEMOTION message. When I
move the mouse slowly, the coords track correctly, but when I move the
mouse
quickly from left to right they are off by up to 500 pixels by the time I
reach the right side of the screen. If I then again move the mouse
slowly,
I still do not get the proper coords indicating that it is not a case of
my
event polling loop not keeping up with the mouse. Any ideas?

It’s a bug that I haven’t been able to solve. It appears to be something
involved with the mouse driver in Windows, but I have no idea why it would
happen only in OpenGL mode.

Any ideas anyone?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com


I am new to SDL.

I am experiencing a problem with the absolute mouse position in win2k, I
am

working in openGL. I am processing the SDL_MOUSEMOTION message. When I
move the mouse slowly, the coords track correctly, but when I move the
mouse

quickly from left to right they are off by up to 500 pixels by the time
I

reach the right side of the screen. If I then again move the mouse
slowly,

I still do not get the proper coords indicating that it is not a case of
my

event polling loop not keeping up with the mouse. Any ideas?

It’s a bug that I haven’t been able to solve. It appears to be something
involved with the mouse driver in Windows, but I have no idea why it would
happen only in OpenGL mode.

Any ideas anyone?

Sounds like it’s reading the motion counters directly, and not accounting
for acceleration.

-Jason

----- Original Message -----
From: slouken@devolution.com (Sam Lantinga)
To:
Sent: Thursday, March 28, 2002 11:22 AM
Subject: Re: [SDL] Incorrect mouse motion…

i think that SDL have some troubles with mouse uder win32

Have you had any other troubles? As far as I know, that’s the only problem.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sounds like it’s reading the motion counters directly, and not accounting
for acceleration.

That could be it, but why wouldn’t it happen under DirectX fullscreen mode?
Does going into GL change the input somehow?
If mouse acceleration is turned off, how can we tell, and how can we either
turn it back on or do the acceleration ourselves?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I’ve experienced this problem in twilight as well, although with a different item,
and that is mousewheel behavior. (Mercury) Zephaniah Hull (one of our team members),
has discovered that it has something to do with using windib vs. directinput with
OpenGL, and why it affects only SDL he’s still trying to figure out at last check.

I’ve seen the acceleration problem too under Win XP, although never under Win98SE.

If someone could make SDL use windib for input instead of directinput and see if
the acceleration problem still exists, that might be an interesting test…

-EvilTypeGuyOn Thu, Mar 28, 2002 at 08:22:20AM -0800, Sam Lantinga wrote:

I am new to SDL.

I am experiencing a problem with the absolute mouse position in win2k, I am
working in openGL. I am processing the SDL_MOUSEMOTION message. When I
move the mouse slowly, the coords track correctly, but when I move the mouse
quickly from left to right they are off by up to 500 pixels by the time I
reach the right side of the screen. If I then again move the mouse slowly,
I still do not get the proper coords indicating that it is not a case of my
event polling loop not keeping up with the mouse. Any ideas?

It’s a bug that I haven’t been able to solve. It appears to be something
involved with the mouse driver in Windows, but I have no idea why it would
happen only in OpenGL mode.

Any ideas anyone?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hmmm, my mouse wheel seems to be working correctly in Win2k. What mouse
wheel behaviour are you seeing?

John> ----- Original Message -----

From: eviltypeguy@qeradiant.com (EvilTypeGuy)

I’ve experienced this problem in twilight as well, although with a
different item,
and that is mousewheel behavior.

Steve,

The exact problem is that the mouse co-ordinates behave as if the screen
resolution is 640 x 480 when using OpenGL in fullscreen mode. The 640 x
480
"window" then pans around to follow the cursor!

This is exactly the problem that I appear to be having. I am running in
1280x1024. I think the others are correct in that it has to do with
acceleration. If I move the mouse VERY slowly, it tracks correctly. Maybe
SDL is not the way to go for my application. It is critical that I have
accurate mouse positioning.

John

This is exactly the problem that I appear to be having. I am running in
1280x1024. I think the others are correct in that it has to do with
acceleration. If I move the mouse VERY slowly, it tracks correctly. Maybe
SDL is not the way to go for my application. It is critical that I have
accurate mouse positioning.

Like I said, this is a bug (in fact the only bug holding up SDL 1.2.4),
so as soon as somebody figures out how to fix it, we will.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

The mouse wheel stops working in our SDL app under Windows XP for me, I haven’t
personally tried Windows 2000 but we’ve had some reports from some win2k users.

Basically, we roll the mousewheel once and suddenly no more mousewheel. This
doesn’t happen when running the application under Linux or Windows 98…

-EvilTypeGuyOn Thu, Mar 28, 2002 at 07:48:48PM -0500, John Lagerquist wrote:

Hmmm, my mouse wheel seems to be working correctly in Win2k. What mouse
wheel behaviour are you seeing?

John

----- Original Message -----
From: “EvilTypeGuy”

I’ve experienced this problem in twilight as well, although with a
different item,
and that is mousewheel behavior.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

the probleme is with mouse acceleration if you disable mouse acceleration the
mouse coordinates and motion will be ok

Okay, thanks to everyone’s help, this bug has been fixed.
You can grab the fix in the latest CVS snapshot:
http://www.libsdl.org/cvs.html

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment