Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MACaveli7

macrumors newbie
Original poster
Oct 15, 2010
23
0
Howdy folks, I can't seem to locate the event for my application losing and gaining the focus, my app is full screen so I assume that is why the kEventClassWindows events will not work.

There is a kEventAppFrontSwitched in the kEventClassApplication events, but from the sounds of it this will tell me when the front application loses focus not my particular application.

Any help with this will be mucho appreciated.
 
kEventAppActivated/kEventAppDeactivated seems to only work when the user clicks out of or on the screen, so is not useful in full screen.
 
So do you mean if the user performs a keyboard command, such as command-tab, to switch apps, that event isn't called?
 
It might be, but I need to know when something such as an overlay appears that takes the focus away from the app.
 
One of these might work (from CarbonEvents.h).

kEventAppFocusNextFloatingWindow?

/*--------------------------------------------------------------------------------------*/
/* Application Events */
/*--------------------------------------------------------------------------------------*/

/*
kEventClassApplication quick reference:

kEventAppActivated = 1,
kEventAppDeactivated = 2,
kEventAppQuit = 3,
kEventAppLaunchNotification = 4,
kEventAppLaunched = 5,
kEventAppTerminated = 6,
kEventAppFrontSwitched = 7,

kEventAppFocusMenuBar = 8,
kEventAppFocusNextDocumentWindow = 9,
kEventAppFocusNextFloatingWindow = 10,
kEventAppFocusToolbar = 11,
kEventAppFocusDrawer = 12,

kEventAppGetDockTileMenu = 20,
kEventAppUpdateDockTile = 21,

kEventAppIsEventInInstantMouser = 104,

kEventAppHidden = 107,
kEventAppShown = 108,
kEventAppSystemUIModeChanged = 109,
kEventAppAvailableWindowBoundsChanged = 110,
kEventAppActiveWindowChanged = 111
*/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.