Re: select Button
Re: select Button
- Subject: Re: select Button
- From: Andrew <email@hidden>
- Date: Wed, 1 Jan 2003 10:48:48 +1100 (EST)
On Tue, 31 Dec 2002, John Q. wrote:
>
I would like to jump from button to button with the courser keys!!
>
And if i press enter the funktion get called!!
If you need to intercept key presses the way I ended up having to do it
was to use a custom subclass of NSWindow and override sendEvent.
- (void)sendEvent:(NSEvent *)anEvent {
if (([anEvent type] == NSKeyDown) &&
([[self delegate]
respondsToSelector:@selector(keyDownInWindow:)]) &&
([[self delegate] keyDownInWindow:anEvent] == TRUE)) {
return;
}
[super sendEvent:anEvent];
}
Obviously you could check to see if it was a cursor key and only send
those to your delegate or do that check in keyDownInWindow.
I got the basis of this code from someone else's very helpful posting to
this list although their name temporarily escapes me.
Andrew
_______________________________________________
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.