简体   繁体   中英

Detecting screen capture in progress

How can I detect when a screen shot selection (cmd-shift-4) is in progress?

I have a custom window that I'm trying to make behave like a menu (it comes out of a status item). Part of this behavior is dismissing it when the user clicks on something else, which I detect using a CGEventTap. One case where I don't want a click to dismiss is when it's the start of a screen shot selection. Is there any way to detect this?

I'm talking about the "capture some of your screen" feature described here: http://support.apple.com/kb/HT5775

I believe I've found the answer: check whether /usr/sbin/screencapture is running.

I opened Activity Monitor, sorted by process ID, and hit cmd-shift-4. screencapture appeared at the top of the list for the duration of the screen capture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM