• 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: Keyboard Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Reading keyboard
      • From: Renaud Boisjoly <email@hidden>
  • Prev by Date: Re: NSFormatter Question: NSTextField should not be left blank
  • Next by Date: Reading keyboard
  • Previous by thread: Re: Keyboard Events
  • Next by thread: Reading keyboard
  • Index(es):
    • Date
    • Thread