Actually, you can cancel that last request. I found it in the documentation. I'm adding (in my personal copy) a call to "SetCapture" when a mouse button is pressed and to "ReleaseCapture" when it is released.
This leaves open the question of multiple buttons. It would be nice to make Windows behave like X11 in that the mouse is not released until all buttons have been released, but this will involve tracking which buttons have been pressed and released over time. This is more of a change than I am up to at the moment, so I plan simply to add a comment to this effect for now.
John F. Fay
From: Fay John F Contr AAC/WMG
Sent: Tuesday, October 05, 2004 3:12 PM
Subject: RE: [Freeglut-bugs] Mouse position
I've been trying out your mouse position fix and I have a problem. My primary platform is Windows XP, although I do have a Linux box on the side.
On Windows, when the mouse moves outside the window, the mouse messages stop. I find this the case even when a button has been pressed and held. In my multi-window application, the mouse messages start getting passed in for the inactive window instead of for the active window, and the mouse x- and y-coordinates are never outside the window bounds.
On Linux, I find that when I press and hold a button and move the mouse outside the window, the messages keep coming to the active window. I do indeed find that the x- and y-coordinates can be negative.
The question, then, is twofold: (1) How do we get Windows to keep sending mouse messages to the active window, and (2) how do we make sure that the x- and y-coordinates match those from Linux? You have given the answer to the second one, but I am still looking for the answer to the first question. I would appreciate any guidance people could offer.
John F. Fay
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of email@example.com
Sent: Wednesday, September 29, 2004 4:45 PM
Subject: [Freeglut-bugs] Mouse position
I don't know if it's really a bug, but I've found a difference between
the behaviour of freeglut on win32 and on Linux/Unix :
On linux, the mouse cursor position can take a negative x value when it
is at left, outside the main window
(and an y negative value when it is above).
On win32, the value is always positive (0 to 65536), so we have a value
around 65000 instead of a negative value.
I 've solve this problem in my program with a code like this:
if (mousePos.x > 32768) mousePos.x -= 65536;
if (mousePos.y > 32768) mousePos.y -= 65536;
Should this test be included in freeglut ?
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
Freeglut-bugs mailing list