• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: current mouse buttons state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: current mouse buttons state (From: Charles Crowley <email@hidden>)

  • Prev by Date: Re: Zerolink deactivate?
  • Next by Date: Re: Cocoa daemon
  • Previous by thread: Re: current mouse buttons state
  • Next by thread: Re: current mouse buttons state
  • Index(es):
    • Date
    • Thread