简体   繁体   English

如何在macOS / OSX中捕获锁定/解锁事件时间

[英]How to capture Lock/Unlock event time in macos/osx

I am working on a project where, I need to capture Lock/Unlock and switch user event time in UTC time zone. 我正在一个项目中,我需要捕获锁定/解锁并在UTC时区中切换用户事件时间。 It is solved for windows and Ubuntu, BUT I am stucked for MACOS/OSX. Windows和Ubuntu都可以解决此问题,但我仍然对MACOS / OSX感到困惑。 Any suggestion will be highly appreciable. 任何建议都是非常可取的。

NSWorkspace sends some notifications you could observe, eg for wake/sleep events. NSWorkspace发送一些您可以观察到的通知,例如唤醒/睡眠事件。 Screen lock/unlock can be catched via similar means. 屏幕锁定/解锁可以通过类似方式进行。 For this refer to the answers of this question . 为此,请参阅此问题的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM