Re: Unable to receive keyDown Event in NSBorderlesswindow
Re: Unable to receive keyDown Event in NSBorderlesswindow
- Subject: Re: Unable to receive keyDown Event in NSBorderlesswindow
- From: Ron Fleckner <email@hidden>
- Date: Thu, 11 Mar 2010 23:58:18 +1100
On 11/03/2010, at 10:57 PM, Poonam Virupaxi Shigihalli wrote:
Hi,
I am using NSBorderless style mask for window and I am unable to
receive the NSKeyDown event for that window.But if I make the window
style as titled then I am able to receive the keyDown events.
I am using below function for Keydown event:
- (void)keyDown:(NSEvent *) event
Thanks,
Poonam
Hello Poonam,
in your window subclass, you need to override -canBecomeKeyWindow to
return YES
From the NSWindow class reference:
canBecomeKeyWindow
Indicates whether the window can become the key window.
- (BOOL)canBecomeKeyWindow
Return Value
YES if the window can become the key window, NO otherwise.
Discussion
Attempts to make the window the key window are abandoned if this
method returns NO. The NSWindowimplementation returns YES if the
window has a title bar or a resize bar, NO otherwise.
Hope that helps,
Ron
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden