system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 How does Snapchat know I took a screenshot?
gpt
This is a sensible question because the physical buttons on your device generally interact directly with the overarching OS (the home button, the lock button, the volume buttons, etc) all appear to deal with the phone directly, and not the individual apps, so it makes sense to wonder how the app itself notices. 

However, the operating system still provides 'hooks' for apps to link their functionality into these button presses, and where applicable, override their normal functionality. 

For example, in IOS the volume-up button is override by the camera-app, as a shutter-button. 

Also in IOS, a screenshot is taken by pressing the home and lock buttons at the same time. Now, if snapchat were to '*override*' the functionality (replace it with something else - like your phone makes a fart  noise instead of going back to the home screen) then it would likely render your phone unusable (as you'd be stuck in the app, without a back button) and thus would likely not be allowed in the IOS appstore. 


However, if it listens for the event (the home/lock button being pressed), does some stuff, *then* allows the normal function of the home/lock button to go ahead in a timely fashion, then the appstore will allow it. 

Normal use of this would be to gracefully handle the closing of an app (e.g. to save stuff you're in the middle of so it can be resumed later)...snapchat just uses this millisecond to process "The home button is pressed - is the lock button pressed simultaneriously? IF yes, record that a screenshot was taken, and notify whoever's currently on screen, if not, invoke the normal back-button process" 

Make sense?