a key down event problem
a key down event problem
- Subject: a key down event problem
- From: Fei Li <email@hidden>
- Date: Tue, 27 May 2003 09:53:57 -0600
Hello all,
I have a strange problem with key down event.
I have a full screen window which need to receive esc key event to
terminate the application. I use:
- (BOOL)canBecomeKeyWindow
{
return YES;
}
- (BOOL)canBecomeMainWindow
{
return YES;
}
-(void)keyDown:(NSEvent *)theEvent
{
unsigned short theKey;
theKey = [theEvent keyCode];
if (theKey == 53) //ESC key
{
[NSApp terminate:self];
}
}
in my window class. This works fine on MacOSX 10.1, but doesn't work on
MacOSX 10.2. The more strange thing is, on MacOSX 10.2, this also works
fine when I select Build & Run or Run Executable in ProjectBuilder, but
if I run it from finder window, my keyDown function will not be fired
(as I put a NSLog message in keyDown and it doesn't appear in console).
I'm really confused. If anyone have any idea about it?
Thanks for any information!
Fei
_______________________________________________
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.