Whenever I accidentally press the power button on my MacBook, it switches off the display. This behaviour change happened from OS X Mavericks (10.9).
Earlier it used to let us choose with following options:
OSXDaily.com has got a workaround for this trouble. It does not straightaway enable these options the moment you press the power button, but it prevents OS X Mavericks from switching the display off, which is far more relieving.
To invoke the above power button options: press power button continuously for a second or two.
Pingback: OFF-TOPIC: Change Power Button Behaviour in OS X Mavericks : Interesting Findings & Knowledge Sharing