Hacker News new | ask | show | jobs
by diebeforei485 2247 days ago
Likely by detecting certain keystrokes (that's what Snapchat does on iOS for example). Idk if there are other ways on macOS or Windows.
2 comments

There is an API on iOS: UIApplicationUserDidTakeScreenshotNotification

https://developer.apple.com/documentation/uikit/uiapplicatio...

I was not aware of this- thank you!
Definitely not on Linux. Global hotkeys are managed by the compositor and can't be spied on by applications. There's also no API no read keystrokes from external apps. This is actually a security feature.

AFAIK, on iOS, the app is actually sent an event by the OS when a screenshot is captured.

You might be specifically talking about Wayland here then, but with X on the other hand, it's not difficult for example [0]

[0] https://security.stackexchange.com/questions/170596/is-it-po...