My daughter's favorite prank is to sneak up on me while I work and deftly press the laptop's power key. The result is a loss of 10 minutes of time for the shutdown / on process (Windows, a laptop is 5 years old, there is little memory by today's standards, there are a lot of programs installed). Since educational measures yielded nothing, I had to resort to technical measures:
Control Panel -> Power Options -> Advanced Tab When I press the power button on my computer - I select from the list “Do nothing”.
I remember that when the lid is slammed, my laptop also falls intolerable long sleep (goes into Hibernate mode), and then wakes up just as long.
When I am close the lid of my portable computer - I choose from the list “Do nothing” instead of “Hibernate”.