How to detect desktop idle time from an Electron app?

前端 未结 4 1088
情话喂你
情话喂你 2021-02-06 10:01

I need my Electron app to respond to the user becoming idle (no mouse or keyboard inputs to any program on the OS) for a certain amount of time.

How can I trigger a func

4条回答
  •  花落未央
    2021-02-06 10:30

    Look at Electron Power monitor API's and use

    powerMonitor.getSystemIdleTime()
    

提交回复
热议问题