Best way to know if application is inactive in cocoa mac OSX?

前端 未结 5 1893
旧时难觅i
旧时难觅i 2021-02-09 06:03

So, i am building a program that will stand on a exhibition for public usage, and i got a task to make a inactive state for it. Just display some random videos from a folder on

5条回答
  •  被撕碎了的回忆
    2021-02-09 06:50

    This might sound like a silly question; but why not just set up a screensaver, with a short fuse?

    You can listen for the NSNotification named @"com.apple.screensaver.didstart" if you need to do any resets or cleanups when the user wanders away.

    Edit: You could also set up the screen saver; wait for it to fire, and then do your own thing when it starts, stopping the screen saver when you display your own videos; but setting up a screen saver the proper way is probably a good idea.

提交回复
热议问题