AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mouse/Keyboard inactive for

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
emerysteele



Joined: 30 Jul 2009
Posts: 10

PostPosted: Sun Nov 15, 2009 11:42 pm    Post subject: Mouse/Keyboard inactive for Reply with quote

I want a script that will tell if the keyboard/mouse has been inactive for 10 minutes and then shut the monitor off with 'Run "C:\Windows\nircmd.exe" monitor off'. The reason i want to do this instead of using the built in feature of windows, is because I want to set it up so it will detect if youtube is open, and if it is, then the monitor won't go off.
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 722
Location: Iowa, USA

PostPosted: Mon Nov 16, 2009 1:03 am    Post subject: Reply with quote

Check out the built-in variable A_TimeIdlePhysical
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
emerysteele



Joined: 30 Jul 2009
Posts: 10

PostPosted: Mon Nov 16, 2009 5:48 am    Post subject: Reply with quote

Perfect. I used the following code to achieve what I want.

Code:

#Persistent
SetTimer, CheckIdle, 60000 ; Check every 1 minute
return

CheckIdle:
if A_TimeIdle >= 600000 ; after 10 minutes idle time
{
  IfWinExist, YouTube
  {
   
  }
  else
  {
    Run "C:\Windows\nircmd.exe" monitor off ; Puts monitor into standby mode
  }
}
return


You must have nircmd for this to work.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group