• 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: Catching all keyDowns and mouseDowns in application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching all keyDowns and mouseDowns in application


  • Subject: Re: Catching all keyDowns and mouseDowns in application
  • From: Jeremy Dronfield <email@hidden>
  • Date: Fri, 11 Jun 2004 11:47:18 +0100

Hi joar

As is often the case, I though of the solution within twenty minutes of posting the question. Subclassing NSApplication was the idea I came up with. However, since I had a notion that this might be inadvisable, it's nice to have it validated.

Just for the archive, I might add that it's necessary in this case to check that the event is a keyDown or mouseDown before handling it, since -sendEvent: picks up *all* events, including mouseMoved events when the application is in the background.

Thanks,
-Jeremy

On 11 Jun 2004, at 11:19 am, j o a r wrote:

Subclass NSApplication, and override "sendEvent:".

j o a r

On 2004-06-11, at 12.14, Jeremy Dronfield wrote:

I have a feeling this may be a FAQ, but can't find anything in the
archives.

I'm trying to implement a timed inactivity lockout in my application,
so that if there are no key or mouse events for a set period of time,
the application locks the user out, requiring a password to unlock.
Since I don't want to have to subclass every window in the application
and override -keyDown: and -mouseDown: in each of them, is there a way
to catch all key and mouse events at one point in the responder chain?

If not, can anyone suggest a better way of handling this sort of
inactivity timeout?

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.
_______________________________________________
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: 
 >Catching all keyDowns and mouseDowns in application (From: Jeremy Dronfield <email@hidden>)
 >Re: Catching all keyDowns and mouseDowns in application (From: j o a r <email@hidden>)

  • Prev by Date: lowercaseString on Jaguar
  • Next by Date: Re: Ordered NSDictionary
  • Previous by thread: Re: Catching all keyDowns and mouseDowns in application
  • Next by thread: lowercaseString on Jaguar
  • Index(es):
    • Date
    • Thread