RainRain
RainRain

Reputation: 453

Mac development, objective-c: can I detect when user switch tasks like closing a window, activating to another window?

I am developing a desktop application that capture computer activities on mac osx using objective-c. I know it's possible to capture it when user presses on the keyboard and mouse position. But I don't know how to detect when user switches tasks on computer, like closing a window (of other applications), activating another window (of other applications)?

Does anyone have any experience in that?

Upvotes: 0

Views: 208

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Yes, via the Accessibility system. For example the NSAccessibilityMainWindowChangedNotification.

Upvotes: 1

Related Questions