• 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: Trap mouse and keyboard events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trap mouse and keyboard events


  • Subject: Re: Trap mouse and keyboard events
  • From: Richard Somers <email@hidden>
  • Date: Mon, 25 Jun 2012 16:35:07 -0600

On Jun 24, 2012, at 11:56 PM, Abhijeet Singh wrote:

> I want to perform some action in my application whenever user presses any key on keyboard or uses the mouse. How can I trap these events.

One way to do this would be to subclass NSApplication and override sendEvent:. The documentation indicates "Override sendEvent: if you want to change how events are dispatched or perform some special event processing."

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/nsapplication_Class/Reference/Reference.html

--Richard


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Trap mouse and keyboard events (From: Abhijeet Singh <email@hidden>)

  • Prev by Date: Re: Why do we use -fobjc-arc instead of removing code with #define?
  • Next by Date: Re: Why do we use -fobjc-arc instead of removing code with #define?
  • Previous by thread: Re: Trap mouse and keyboard events
  • Next by thread: CALayer coordinates question
  • Index(es):
    • Date
    • Thread