Capturing a key press
Capturing a key press
- Subject: Capturing a key press
- From: patrick <email@hidden>
- Date: Tue, 10 May 2005 13:51:13 -0700
I have an application with a QTMovieView. Normally, pressing keys like
space or the arrow keys will control the movie. I want to be able to
be able to do something when the escape key is pressed, and my
solution seems to break the normal handling of the key events. I have:
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (void)keyDown:(NSEvent *)theEvent
{
NSLog(@"Characters : %@", [theEvent charactersIgnoringModifiers]);
if ([[theEvent charactersIgnoringModifiers] characterAtIndex:0] == 0x1b)
{
/* insert special code here... */
}
else
{
[super keyDown:theEvent];
}
}
I would have thought that by passing the event to the super's handler
for non-Escape key presses that normal handling of the event would
resume, but this is not the case. The space key no longer pauses and
plays the movies, etc.
Is there a more proper way to do this?
_______________________________________________
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