Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: EventMonitorTarget and background apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EventMonitorTarget and background apps



on 2007-07-16 4:46 PM, Mike at email@hidden wrote:

> I have a simple Carbon app in which I install a monitor handler using
> GetEventMonitorTarget. I then use my handler to get keystrokes from
> other apps when they are typed.
>
> I now want to enable my app to run as a background-only app with no UI
> and still be able to get events in my handler when keys are typed.
>
> I added the two required flags, LSBackgroundOnly and LSUIElement to my
> app's Info.plist file and that works fine - my app launches in the
> background only.
>
> The problem is, when I launch my app in the background only, my monitor
> handler never gets called and I never receive any copies of the events I
> receive when my app is running as a normal GUI-based app.
>
> Is there something else I need to do in order to have my app run as a
> background only app and still be able to receive events on my monitor

You have to use Quartz event taps, new in Tiger. Find the "Quartz Event
Services Reference" document in Apple's documentation. You can download a
free demo application to test how event taps work at
<http://prefabsoftware.com/eventtapstestbench/>.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com

PreFab Software - www.prefabsoftware.com


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

This email sent to email@hidden

References: 
 >EventMonitorTarget and background apps (From: Mike <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.