Programmatically wake display on OSX

后端 未结 2 624
野性不改
野性不改 2021-02-10 04:30

I\'ve managed to get the display to sleep immediately with

pmset displaysleepnow

in terminal, however for waking the display I\'ve only found

2条回答
  •  后悔当初
    2021-02-10 04:48

    Got it working with:

      IOPMAssertionID assertionID; 
      IOPMAssertionDeclareUserActivity(CFSTR(""), kIOPMUserActiveLocal, &assertionID);
    

提交回复
热议问题