W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
power-monitor
模塊是用來監(jiān)聽能源區(qū)改變的.只能在主進(jìn)程中使用.在 app
模塊的 ready
事件觸發(fā)之后就不能使用這個(gè)模塊了.
例如:
app.on('ready', function() {
require('electron').powerMonitor.on('suspend', function() {
console.log('The system is going to sleep');
});
});
power-monitor
模塊可以觸發(fā)下列事件:
在系統(tǒng)掛起的時(shí)候觸發(fā).
在系統(tǒng)恢復(fù)繼續(xù)工作的時(shí)候觸發(fā). Emitted when system is resuming.
在系統(tǒng)使用交流電的時(shí)候觸發(fā). Emitted when the system changes to AC power.
在系統(tǒng)使用電池電源的時(shí)候觸發(fā). Emitted when system changes to battery power.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: