If you are using OS X (And not only) most likely has happened often enough to press accidentally Power button computer and activate Sleep mode, For then you will have to wait a while to get him out of that mode and will resume work (if you think it's any consolation, MacBook sites out much faster than Sleep mode PCs). However, this can become frustrating (not necessarily in time, but right from the first accident of its kind) solution at hand is to activate a Power confirmation dialog gender situations, with which you can turn off the computer to enter Sleep or you can opt for restart or total closure (shutdown) Thereof.
How to enable display a confirmation dialog when you press the Power button of the Power Mac?
If you wish to disable automatic entry into Sleep mode to Mac supplied when you press accidentally Power button by displaying a handshakingFollow the instructions below.
- open Terminal (from Applications> Utilities or try a search in Spotlight)
- type the command defaults write -bool no com.apple.loginwindow PowerButtonSleepsSystem and give Enter
- then restart your Mac for the change to take effect made
After you make this setting, whenever you press Power button of your Mac (intentionally or accidentally) will show a handshaking in which you can click to Sleep mode activated, to restart your Mac or it close completely, Or cancels On button.
If you later want to Sleep mode automatically reactivated entry you press the button Power (Ie not to display confirmation dialog) open again Terminal and type the command defaults write com.apple.loginwindow PowerButtonSleepsSystem -bool yes and give Enter. After restart, Power button default to be restoredAnd your Mac will come automatic Sleep mode when you press the button.
STEALTH SETTINGS - How to Prevent Power button Enabling automatically from Sleep mode in OS X