Caffeine

Prevent your computer from going to sleep

If you have problems with your PC locking or going to sleep, caffeine will keep it awake. It works by simulating a keypress once every 59 seconds, so your machine thinks you're still working at the keyboard, so won't lock the screen or activate the screensaver.

The icon is shown above - it's the leftmost one in the task tray, and this is all you see. Double-clicking the icon empties the coffee pot (that's what the icon is) and temporarily disables the program. Double-clicking it again refills the pot, and will keep your machine awake.

By default the app starts enabled, and works every 59 seconds. There are some command line switches you can use to alter this behaviour:

Comparison of methods

Command lineExplanation
emptyThe F15 'key up' event is used every 59. This is the traditional behavior so is well tested, but can cause issues with Putty sessions, PowerPoint, Google Docs or Smartsheet
-useshiftInstead of F15, the shift key is used. This solves some of the issues with the above apps, but may cause the shift key to become "unpressed" sometimes
-key:xxInstead of F15, the key specified by xx is used. Your choice of key could have side effects
-keypressThis is more likley to cause side effects, as a full key down/key up is generated. It's included for compatibility with older systems which might need this
-stesUses a different method (calling SetThreadExecutionState to tell Windows not to sleep. It works for me, with no side effects, but hasn't had enough testing for me to sure it's entirely better than using F15. Note that this will keep the machine awake, but not simulate activity, meaning any app which tracks user input will not see any.
-allowssThe same as -stes but this time the screensaver can start. Note that this will keep the machine awake, but not simulate activity, meaning any app which tracks user input will not see any.

Video

Caffeine user humancar2n has put together a short YouTube video showing how the app works.

Mac version

Do you need this functionality on your Mac? Intelliscape Software have written a separate app, also named Caffeine, which can help you out.

Versions

v1.97 - April 2021

v1.96 - March 2021

v1.95 - February 2021

v1.90 - October 2020

v1.81 - May 2020

v1.80 - January 2020

v1.64 - September 2017

v1.63 - February 2017

v1.62 - April 2016

v1.61 - October 2015

v1.60 - July 2013

v1.50 - November 2010

Download Caffeine (x86 and x64)