Re: Installing carbon event handlers into a cocoa application
Re: Installing carbon event handlers into a cocoa application
- Subject: Re: Installing carbon event handlers into a cocoa application
- From: "Justin Walsh" <email@hidden>
- Date: Sun, 12 Nov 2006 16:02:27 -0700
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?
Best Regards,
Justin Walsh
On 11/12/06, Ricky Sharp <email@hidden> wrote:
On Nov 12, 2006, at 11:08 AM, Justin Walsh wrote:
> Now I know this may sound strange or silly, and that the most
> obvious and
> abundant response is to just use Cocoa directly to do what i am
> trying to
> do. So please do not reply with such a response.
But you haven't stated what it is you're trying to do.
Note that it is indeed possible (and often the only solution) to
install Carbon event handlers in a Cocoa app. I do this myself to
have better Ink support.
However, depending upon what you want, there may be a better way to
do it all via Cocoa.
> What I am after is using carbon to handle keyboard and mouse input
> in a
> cocoa application. I already have an Input Class that works in
> carbon by
> getting a windowRef from the carbon window and then installing the
> event
> handlers for the keyboard and mouse input, joysticks in the future.
>
> I created a simple cocoa application and am able to get the
> windowRef and
> pass it to my class. From there it is finding the window, and
> installing
> the event handlers without returning any errors. However in the cocoa
> application, it is not showing any response.
>
> I started to look into subclassing the NSApplication class, and
> think this
> is where the solution is. My guess is that cocoa is absorbing the
> keyboard
> and mouse events, because by default it also creates event handlers
> for
> these actions.
>
> My question is, what should i start looking at to disable or
> overwrite the
> keyboard and mouse, so my custom carbon based input code can handle
> the code
> instead. The fact that carbon is handling the windowRef i pass it
> alone
> makes me think that it is perfectly possible to do such a task.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
--
//------------------------------------------------
The blog: http://blog.trickfly.com/
_______________________________________________
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