Re: see if a key is down
Re: see if a key is down
- Subject: Re: see if a key is down
- From: Dietrich Epp <email@hidden>
- Date: Fri, 4 Oct 2002 22:18:09 -0700
On Monday, September 30, 2002, at 02:55 , Julien Palmas wrote:
i run a timer and each time it fires, i want to see if a key is down,
how can i do ?
which key? if it is a modifier key, fire a periodic event once,
intercept it, and check the modifier flags.
If you want a different key, use a subclass of NSApplication and
override -[sendEvent:], keeping track of which keys are down so this
information is available to your timer. You could do this easily enough
with an array. Call the event's -[charactersIgnoringModifiers], iterate
through characters, and remember that the shift / alpha lock will still
capitalize the characters and modifier keys start at 0xf700 (see
NSEvent.h). Don't forget that foreign keyboards will send odder
characters...
What is the purpose ef this? There might be a much better solution.
_______________________________________________
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.