I'm trying to handle key events of full-screen NSWindow. I've subclassed NSWindow and realized methods keyDown and canBecomeKeyWindow (which is returning YES). But my key events are not handling. Here is how i'm creating window:
mainWindow = [[FullScreenWindow alloc] initWithContentRect:screenRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[NSScreen m开发者_StackOverflow社区ainScreen]];
[mainWindow setLevel:windowLevel];
[mainWindow setBackgroundColor:[NSColor blackColor]];
[mainWindow makeKeyAndOrderFront:nil];
Where FullScreenWindow is a subclass of NSWindow. What am i doing wrong?
The esc
key already exists fullscreen by default, you don't have to implement It (tested on 10.10.4).
精彩评论