Re: Cocoa-dev Digest, Vol 3, Issue 406
Re: Cocoa-dev Digest, Vol 3, Issue 406
- Subject: Re: Cocoa-dev Digest, Vol 3, Issue 406
- From: Raleigh Ledet <email@hidden>
- Date: Thu, 30 Mar 2006 10:42:46 -0800
If you need a Cocoa equivalent of the Carbon EventMonitorTarget
please file a bug for it.
Monitor Targeted events only occur when you app is not the
foreground. When you app is in the foreground the events come in the
normal way.
I have a similar problem with tablet proximity events. I register for
the Carbon Event I'm interested in on the MonitorTarget, however, the
event never comes through my installed Carbon Handler. Instead the
event comes through the normal Cocoa event chain. The same is
probably happening for your events as well. Since you app is in the
background, I don't know which view would get the event. It may
behoove you to override NSApp's sendEvent: to catch the event there.
Then reroute or broadcast a notification about the event to the rest
of your app.
-raleigh
On Mar 30, 2006, at 10:24 AM, email@hidden wrote:
On Mar 30, 2006, at 12:13 PM, Tom Harrington wrote:
[And in case anyone's wondering, I'm using Carbon here because Cocoa
doesn't appear to have an equivalent to GetEventMonitorTarget().
Using NSEvent doesn't cut it here because it won't receive the events
unless my app is in the foreground, while GetEventMonitorTarget()
will
receive the events at all times.]
Unfortunately, this is not the case. From the GetEventMonitorTarget()
docs:
Handlers installed on the event monitor target receive events only
when
the current application is inactive. When the current
application is
active, all events flow through the event dispatcher target, and
no events
are sent to the event monitor target.
So you'd need to run it in a separate process if you want it to
capture all events.
--
Mike Blaguszewski / Ambrosia Software, Inc.
_______________________________________________
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