1,
有的时候需要监听Electron的系统恢复事件(从睡眠、休眠中恢复,或者从锁屏状态恢复),这个时候我们会使用Electron主进程powerMonitor模块的resume事件或者unlock-screen事件。如下代码所示: let {powerMonitor} = require("electron") powerMonitor.on('resume', () => { //执行你的逻辑 }) powerMonitor.on('unlock-screen', () => { //执行你的逻辑 }) powerMonitor.on('resume', () => { powerMonitor.once('unlock-screen', () => { //执行你的逻辑 }) })
标签:resume,screen,0008,electron,unlock,powerMonitor,事件 From: https://www.cnblogs.com/eliteboy/p/16769672.html