Re: Keyboard Events
Re: Keyboard Events
- Subject: Re: Keyboard Events
- From: Kyle Wheeler <email@hidden>
- Date: Sun, 9 Jun 2002 12:56:24 -0700 (PDT)
On Saturday, June 08, 2002, at 04:36AM, Nathan Day <email@hidden> wrote:
>
Have you looked at NSResponder and the two methods
>
- (void)keyDown:(NSEvent *)theEvent
>
- (void)keyUp:(NSEvent *)theEvent
>
>
>
On Saturday, June 8, 2002, at 04:57 AM, Marcos Tirao wrote:
>
>
> Hi! I have read the Cocoa documentation but I couldn't get keyboard
>
> events work
I've played around with NSTextField's a fair amount, and as best as I can tell, they don't receive keyDown events - there's some other event in there that they receive. They DO, however, receive keyUp events (I'm sure this makes sense somehow, perhaps something to do with people being able to hold down a key maybe?).
Anyway, the way I get keyUp events is I created my own subclass of NSTextField that overrides keyUp and acceptsFirstResponder (sp? I'm away from my source at the moment).
~Kyle Wheeler
_______________________________________________
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.