Re: current mouse buttons state
Re: current mouse buttons state
- Subject: Re: current mouse buttons state
- From: Eric Schlegel <email@hidden>
- Date: Wed, 12 Nov 2003 22:13:04 -0800
On Nov 12, 2003, at 9:42 PM, Charles Crowley wrote:
Anybody know how to determine the current mouse buttons state ? I
need to determine at some random interval wether the left mouse
button is down or up.
(I know [NSEvent mouseLocation] will give the current mouse location)
It is a deprecated function but
(BOOL) Button()
returns the state of the left (or, strangely enough, the middle) mouse
button.
It is a Carbon function so you must include the Carbon framework in
Frameworks.Linked Frameworks (where Cocoa.framework is).
If you're going with Carbon, I'd suggest the GetCurrentButtonState API,
which lets you check the state of the individual buttons, rather than
the Button API. GetCurrentButtonState is in CarbonEventsCore.h and is
available in 10.2 and later.
-eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.