• 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: Installing carbon event handlers into a cocoa application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Installing carbon event handlers into a cocoa application


  • Subject: Re: Installing carbon event handlers into a cocoa application
  • From: Daniel Jalkut <email@hidden>
  • Date: Sun, 12 Nov 2006 19:35:40 -0500

Hi Justin ...

On Nov 12, 2006, at 6:02 PM, Justin Walsh wrote:

What I am trying to do is handle mouse and keyboard input, eventually
joysticks as well, for my application from an Input class that already works
in carbon apps, windows apps, and linux apps. Really I have no desire to
rewrite sections of the library specifically for cocoa and would much rather
see if there is any way at all to get my carbon event handling into my cocoa
app, without going the full nine yards of recreating the app as eric stated.


Like stated in my original post, it appears to be installing carbon event
handlers into my cocoa application, however I am getting no response to
keyboard and mouse presses.


If cocoa is running a separate event loop for all of this information, can i
not just put a carbon message pump into the cocoa application then to update
the carbon event loop?


Or better yet, how do you accomplish the task of installing carbon event
handlers into cocoa?

In general you "just do it." If you install a carbon event handler in Cocoa it just works, much of the time. But I think for some of the lowest level events it might not work. At least there is some history of functionality that has an equally appropriate way of being handled in Cocoa just being left to Cocoa. So I wouldn't be surprised to learn that plain mouse and key events don't get dispatched to Cocoa clients this way.


If it's that important to keep your event processing system Carbon- specific, then perhaps the most expedient solution here would be to catch all the Cocoa versions of the events (subclass NSApplication and override sendEvent:), and synthesize a carbon event with matching characteristics (MacCreateEvent).

Daniel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Installing carbon event handlers into a cocoa application (From: "Justin Walsh" <email@hidden>)
 >Re: Installing carbon event handlers into a cocoa application (From: Ricky Sharp <email@hidden>)
 >Re: Installing carbon event handlers into a cocoa application (From: "Justin Walsh" <email@hidden>)

  • Prev by Date: Re: Apple Help Viewer and/or Apple Help Indexer problems
  • Next by Date: Re: Re: How to launch an IBAction
  • Previous by thread: Re: Installing carbon event handlers into a cocoa application
  • Next by thread: Re: Installing carbon event handlers into a cocoa application
  • Index(es):
    • Date
    • Thread