Problem reading mouse button state
Hey,
I'm trying to read the state of mouse buttons in my app. Anyway, I've got a problem. I've tried glutMouseFunc(), Mouse(), and GetCurrentButtonState() and all three have the same problem. When only pressing the mouse, everything works fine. However, when I do something else in the game (move for instance) the up call is not always recieved when the mouse is released.
In other words, the system still registers that the mouse is being held down. Clicking the mouse again (when not moving) or even moving the mouse fixes the problem.
I'm at a loss for what to do now. Anyone have suggestions or experience with a similar issue?
Thanks.
I'm trying to read the state of mouse buttons in my app. Anyway, I've got a problem. I've tried glutMouseFunc(), Mouse(), and GetCurrentButtonState() and all three have the same problem. When only pressing the mouse, everything works fine. However, when I do something else in the game (move for instance) the up call is not always recieved when the mouse is released.
In other words, the system still registers that the mouse is being held down. Clicking the mouse again (when not moving) or even moving the mouse fixes the problem.
I'm at a loss for what to do now. Anyone have suggestions or experience with a similar issue?
Thanks.
How about some code? Could you post the code that's in mouse();
Iceman
Iceman
Well if this is a carbon app, you could use Button() for the mouse button and GetMouse(Point *point) for the mouse position.
I'm not too sure since I program in Objective-C but try looking at some of the source code in GLUTExamples in /Developer/Examples/GLUTExamples/ .There's a little program that uses mouse motion and clicking called particles.c. Are you using fullscreen?
Iceman
Iceman
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| [C++] How do you implement a state chart or state machine? | riruilo | 1 | 2,637 |
Jul 27, 2009 10:37 PM Last Post: wadesworld |
|
| Left mouse button causes moueup event despite button still being pressed. | QuestingCordiial | 28 | 10,216 |
Jun 21, 2008 03:18 PM Last Post: AnotherJake |
|
| Mouse button enabler, like GamePad Companion | setera | 4 | 3,908 |
Apr 30, 2006 06:32 PM Last Post: setera |
|
| State Tables and Event Handling | geolycosa | 1 | 2,266 |
Aug 29, 2005 12:58 PM Last Post: ThemsAllTook |
|
| State of OpenAL? | KenD | 16 | 6,166 |
Jul 11, 2003 05:35 PM Last Post: Iceman |
|

