Re: Detecting Keydowns
Re: Detecting Keydowns
- Subject: Re: Detecting Keydowns
- From: Eric Peyton <email@hidden>
- Date: Tue, 12 Jun 2001 08:58:08 -0500
If you are in a hard loop (i.e. you aren't using timers to fire the
next iteration, you are in a while (1), etc.) you can usually use
the nextEvent (nextEventMatchingMask:) methods on NSApplication to
get and deploy (postEvent: or sendEvent:) the next event on the
stack. Then you can just register your view to accept key down
events and when you get a keyDown: check the event's modifier flags
to see if Cmd is being pressed and if the key down character
was '.'.
Read up on NSApplication and NSEvent.
I can give you a better example if you need code, but this is the
method I have used in the past.
Eric
On Monday, June 11, 2001, at 11:15 PM, Steve Gehrman wrote:
How can I tell if the user is holding down a key on the keyboard
(ie cmd period to stop a loop.)
steve
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev