Re: Getting Keyboard Events at Full Screen
Re: Getting Keyboard Events at Full Screen
- Subject: Re: Getting Keyboard Events at Full Screen
- From: Brian Christensen <email@hidden>
- Date: Fri, 23 Nov 2001 10:54:22 +0100
On Friday, November 23, 2001, at 07:16 AM, cocoa-dev-
email@hidden wrote:
After following all the directions at cocoadevcentral.com (including the
part on how to get key events) I still can't grab them.
Before, I made a view and in the MyView.m file I included this:
- (void)awakeFromNib
{
[mainWindow setFirstResponder:self];
}
And it worked!
Now it's more complicated. Since I created the window programmatically,
it
can't be an IBOutlet and I have to access it with [NSApp keyWindow].
Now I have subclassed NSWindow and overridden canBecomeKeyWindow and
even
isKeyWindow, but still can't get it to work.
If you can help, but need the source, I'll gladly give it to you.
Are you creating the window like this?
// Put up a new full screen window
mainWindow = [[MyWindow alloc] initWithContentRect:screenRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[NSScreen
mainScreen]];
(Not using [[NSWindow alloc] etc] but rather [[MyWindowSubclassHere
alloc] etc]).
-- Brian