is it possible to make Windows 7 laptop go onto sleep mode even if there is mouse movement?
I want it to go to sleep after lets say 30 minutes if there is no keyboard input, but even if there is mouse input, and I want it to wake up on keypress only, not on mouse input
Is it possible to do this, preferably from within Windows, without installing any other software?
Asked
Active
Viewed 273 times
0
user13267
- 1,481
- 7
- 27
- 56
-
Setting an autohotkey/autoit script that log keyboard activity and send the standby command on timer would do the trick. But it use other software. – Martheen Apr 21 '13 at 14:43
-
I had thought about that, but can I make it ignore mouse input? The fact that the mouse is being moved will still be detected by the OS which will prevent it from going to sleep.I don't want mouse movement to prevent the OS from going to sleep – user13267 Apr 22 '13 at 00:11
-
Of course it can. Here's how it works, it run an infinite loop, that check every second. Everytime a key is pressed, the time is logged to a variable. Once the check find out the variable is older than a determined time span, it send one of the command described here http://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu – Martheen Apr 22 '13 at 02:14
-
ok I understand what I need now. I need something like a keylogger that continuously monitors keystrokes and keeps track of a timer. The timer is reset every time a keypress is detected. When the timer reaches 30 minutes it should issue a sleep command, but I have to disable the Windows built in sleep feature. Thank you for your help. Now if I can only understand how to make a program capture keypresses even when it's window is not focused, I should be able to do this in C – user13267 Apr 22 '13 at 06:22
-
Why not simply use autohotkey or autoit? They can capture keypress even when not focused – Martheen Apr 22 '13 at 08:33
-
I have never used autoit/autohotkey before, but I'll give it a try. By the way , will continuously running the script in a infinite loop increase the CPU usage or slowdown my computer eventually? Is this a possibility that should be avoided by careful programming or I don't need to worry about it? – user13267 Apr 22 '13 at 08:52
-
Simply make each loop to delay processing for few seconds, such as http://www.autoitscript.com/autoit3/docs/functions/Sleep.htm – Martheen Apr 23 '13 at 01:23