Problem reading mouse button state

Bossa Nova
Unregistered
 
Post: #1
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.
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #2
How about some code? Could you post the code that's in mouse();

Iceman
Quote this message in a reply
Member
Posts: 50
Joined: 2002.12
Post: #3
Well if this is a carbon app, you could use Button() for the mouse button and GetMouse(Point *point) for the mouse position.
Quote this message in a reply
Member
Posts: 196
Joined: 2002.04
Post: #4
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
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [C++] How do you implement a state chart or state machine? riruilo 1 3,152 Jul 27, 2009 10:37 PM
Last Post: wadesworld
  Left mouse button causes moueup event despite button still being pressed. QuestingCordiial 28 11,585 Jun 21, 2008 03:18 PM
Last Post: AnotherJake
  Mouse button enabler, like GamePad Companion setera 4 4,450 Apr 30, 2006 06:32 PM
Last Post: setera
  State Tables and Event Handling geolycosa 1 2,556 Aug 29, 2005 12:58 PM
Last Post: ThemsAllTook
  State of OpenAL? KenD 16 6,846 Jul 11, 2003 05:35 PM
Last Post: Iceman