I have a custom NSView called SurfaceView. It is the contentView of a NSWindow and it handles basic events like mouse click and drawing. But don\'t matters what I do, it doe
I found out what was preventing the keyDown
event from being called. It was the NSBorderlessWindowMask
mask, it prevents the window from become the key and main window. So I have created a subclass of NSWindow
called BorderlessWindow
:
@interface BorderlessWindow : NSWindow
{
}
@end
@implementation BorderlessWindow
- (BOOL)canBecomeKeyWindow
{
return YES;
}
- (BOOL)canBecomeMainWindow
{
return YES;
}
@end
In addition to answer: Check in your IB checkbox for NSWindow
.
Title Bar
should be checked. It the similar to NSBorderlessWindowMask