Re: A trapped keyDown event
Re: A trapped keyDown event
- Subject: Re: A trapped keyDown event
- From: Eric Gorr <email@hidden>
- Date: Mon, 10 Nov 2008 13:19:34 -0500
I now have a simple test application which demonstrates this problem
http://ericgorr.net/CocoaWithPP.zip
Although, instead of Cmd-N, use Cmd-Q with the NSPanel active. The
application won't quit.
If one clicks on the window and presses Cmd-Q, the application will
quit.
I have entered a bug report:
rdar://6357260
On Nov 7, 2008, at 4:24 PM, Eric Gorr wrote:
The problem I am having is that when my NSPanel is the key window
and I press Cmd-N to create a new document window, the event is not
handled correctly and no new document window is created. If the
NSPanel is not the key window, the event is handled correctly and I
get a new document window.
I am working with NSPanel's in a Carbon based application using the
10.5 SDK. A simple and similar test project can be found at:
http://ericgorr.net/CocoaWithCarbon.zip
However, there is at least one significant difference which allows
that test project to work, but my real application to fail.
The real application was originally written in PowerPlant and that
isn't going to change for awhile. This means that all of the menu
events need to come from WaitNextEvent. For some reason,
WaitNextEvent isn't giving me the keyDown event.
I do have a Carbon Event handler attached watching for
kEventClassCommand / kEventCommandProcess. When my NSPanel is the
key window and I press CMD-N, this event is send and I can set a
breakpoint to see what happens. I have confirmed that the return
value from the handler is eventNotHandledErr. However, as I step out
and back to WaitNextEvent, WaitNextEvent returns false which should
mean in this case that someone did handle the event.
I have attempted to set breakpoints throughout the application where
I am also looking for kEventClassCommand / kEventCommandProcess or
calling WaitNextEvent, but none of these are hit.
It is unclear to me why this is failing, unless there is a bug.
_______________________________________________
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