Re: Getting keyDowns
Re: Getting keyDowns
- Subject: Re: Getting keyDowns
- From: John Stringham <email@hidden>
- Date: Sun, 26 Aug 2001 12:31:15 -0700
You could also make aforementioned KeyHandler class a subclass of
NSResponder and implement the following:
- (void)awakeFromNib
{
if (![theMainWindow makeFirstResponder:self])
NSLog(@"Failed");
}
@end
- (void)keyDown:(NSEvent *)theEvent
{
// Check keys here.
}
Of course this could be a big "no-no" but it worked for me.
- John Stringham
Ack, at 8/26/01, John C. Randolph said:
On Sunday, August 26, 2001, at 11:37 AM, Rosyna wrote:
Does anyone know of any sample code to get keyDowns in an
application? (a window specifically)
I don't know about sample code, but all you need to do is implement
-keyDown:(NSEvent *) theEvent in your window delegate. If nothing
else in the responder chain takes the keys, you'll get them.
-jcr
[Objc retain];
-- Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insane People
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev