Re: keyDown and Enter/Tab keys
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