Hi, ALL,
Is there a way to catch a power cord plug/unplug or a docking station attachment notification?
Or those are not exposed to the programmers?
Thank you.
Hi, ALL,
Is there a way to catch a power cord plug/unplug or a docking station attachment notification?
Or those are not exposed to the programmers?
Thank you.
I found a poweroff NSEvent, but no indication of what it gives.
Type Property
powerOff
No overview available.
macOS 10.12+
Framework
Declaration
See Also
Declaration
static var powerOff: NSEvent.EventSubtype { get }
https://developer.apple.com/documentation/appkit/nsevent/eventsubtype/1642495-poweroff
I believe they are - checked the IOKit docs on 'managing power' yet? https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/PowerMgmt.html#//apple_ref/doc/uid/TP0000020-SW4