• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A trapped keyDown event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A trapped keyDown event


  • Subject: Re: A trapped keyDown event
  • From: Eric Gorr <email@hidden>
  • Date: Fri, 7 Nov 2008 17:00:14 -0500


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.


I suppose a workaround could be to convert the carbon event into one of the old EventRecord's and call PowerPlants DispatchEvent function directly.


Sadly, this potential workaround won't work. ConvertEventRefToEventRecord will not convert a kEventClassCommand / kEventCommandProcess event.

It is unclear to me how I can workaround this problem.


Any thoughts or comments would be appreciated. _______________________________________________

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


References: 
 >Re: Cocoa-dev Digest, Vol 5, Issue 1904 (From: "email@hidden" <email@hidden>)
 >Re: A finished moving notification for a window? (From: "email@hidden" <email@hidden>)
 >Re: A finished moving notification for a window? (From: Eric Gorr <email@hidden>)
 >Re: A finished moving notification for a window? (From: "email@hidden" <email@hidden>)
 >Re: A finished moving notification for a window? (From: Eric Gorr <email@hidden>)
 >Re: A finished moving notification for a window? (From: James Walker <email@hidden>)
 >Re: A finished moving notification for a window? (From: Eric Gorr <email@hidden>)
 >Re: A finished moving notification for a window? (From: Eric Gorr <email@hidden>)
 >A trapped keyDown event (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: dragging an image to Photoshop dock tile
  • Next by Date: Re: Core Data and NSNumber values
  • Previous by thread: A trapped keyDown event
  • Next by thread: Re: A trapped keyDown event
  • Index(es):
    • Date
    • Thread