• 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: keyDown and Enter/Tab keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyDown and Enter/Tab keys


  • Subject: Re: keyDown and Enter/Tab keys
  • From: Carl Gieringer <email@hidden>
  • Date: Thu, 10 Feb 2005 13:04:39 -0900

As far as "enter" goes, I use this code to catch it in a subclassed NSTableView:

- (void) keyDown:(NSEvent *)event
{
	unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0];

if (((key == NSEnterCharacter) || (key == NSCarriageReturnCharacter)) )
{ }
}


If you aren't seeing the keyDown, maybe your view doesn't have firstResponder status. In that case, I believe that the key window sends the keyDown event to it's default button cell (but I have not messed around with this in a program so you should look into it.) See - (NSButtonCell *)defaultButtonCell in the NSWindow documentation.

On Feb 10, 2005, at 12:37, Luc Vandal wrote:

Hi!

why is it that keyDown won't be triggered when the Enter key or Tab key are being pressed?

Thanks!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >keyDown and Enter/Tab keys (From: Luc Vandal <email@hidden>)

  • Prev by Date: Refresh works, but...
  • Next by Date: Re: NSKeyedUnarchiver - unarchiving on a background thread
  • Previous by thread: keyDown and Enter/Tab keys
  • Next by thread: Mouse over menu item event?
  • Index(es):
    • Date
    • Thread