osx - Notification when the system is idle or not on OS X -


I know that there is a way to get system idle time with the IOKit framework on OS X, but I want to know If there are notifications available.

I can make a timer to see that the idle time is higher than X, and that's OK. If a few seconds later detects the passive mode then it does not make any difference.

The problem is that when Mac is no longer inactive, I want my app to show a notification as soon as possible, not a few seconds later.

Is there a notification for this? (IChat has one)

This is from (a note from the bills of the bill)

< Former> - (zero) received soda note: (NSNotification *) note {NSLog (@ "receiveSleepNote:% @", [note name]); } - (zero) received note: (NSNotification *) Note {NSG (@ "Received note:% @", [note name]); } - (Zero) File Notification {// These notifications are filed at NSW Versus Notification Center, not the Basic Notification Center If you file from the default notification center you will not get sleep / espionage information. [[[NSWorkspace sharedWorkspace] Notification Center] addObserver: Self Selector: @selector (receiveSleepNote :) Name: NSWorkspaceWillSleepNotification Object: NULL]; [[[NSWorkspace sharedWorkspace] Notification Center] addObserver: Self Selector: @selector (receiveWakeNote :) Name: NSWorkspaceDidWakeNotification Object: NULL]; }

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -