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 

Keeping monitor off while script is running

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Corelle
Guest





PostPosted: Mon Mar 15, 2010 4:27 am    Post subject: Keeping monitor off while script is running Reply with quote

How do i make it so my script can run while the monitor stays off, i use a laptop and i dont have a separate key to manually turn it off, i set it by inactivity in the power management options, but the script is only keys being hit it counts the script as actual activity, is there a way to make it turn off while script is running?
Back to top
None



Joined: 28 Nov 2009
Posts: 3086

PostPosted: Mon Mar 15, 2010 5:01 am    Post subject: Reply with quote

500 works with my CRT but you may need to make it shorter to keep it off using a Laptop
Code:
F1::SetTimer, IdleCheck, 500
F2::SetTimer, IdleCheck, Off

IdleCheck:
If(A_TimeIdle<500)
SendMessage,0x112,0xF170,2,,Program Manager ;This turns off the screen
Return

Esc::ExitApp
Back to top
View user's profile Send private message
Corelle
Guest





PostPosted: Mon Mar 15, 2010 10:24 pm    Post subject: thanks Reply with quote

thanks that code turns it off, but for some reason the screen flashes every 4 seconds...how do i fix that ?
Back to top
None



Joined: 28 Nov 2009
Posts: 3086

PostPosted: Mon Mar 15, 2010 10:59 pm    Post subject: Reply with quote

What does it Flash?
How often does the other script send Keys?
Did you try increasing the check frequency (need to change the value in the if also)?
Back to top
View user's profile Send private message
Corelle
Guest





PostPosted: Mon Mar 15, 2010 11:03 pm    Post subject: flashing Reply with quote

the flash is just the monitor turns on and off real quick.

the other script sends keys every 2-3 seconds

what should i change the frequency to?

and can i just put this piece of code in the script that sends the keys?

Thanks for the help
Back to top
Scratch



Joined: 22 Jan 2009
Posts: 72

PostPosted: Mon Mar 15, 2010 11:20 pm    Post subject: Reply with quote

Does it still happen if you combine those 2 scripts into a single scipt? , Alternatively does it still happen if you make shortcuts to either the combined or seperate scripts and alter shortcut properties to run them minimized?

Have you checked you BIOS powermanagement settings for wakeup events, like the keyboard?
Back to top
View user's profile Send private message
Corelle
Guest





PostPosted: Mon Mar 15, 2010 11:42 pm    Post subject: Reply with quote

yes it happens when they are combined too and it still happens when i do the minimizing in their properties.

How do i check power management bios?

Thanks,
Back to top
Scratch



Joined: 22 Jan 2009
Posts: 72

PostPosted: Tue Mar 16, 2010 12:17 am    Post subject: Reply with quote

Usually when you power on the computer there is a splash screen and briefly a message appears like:
- Hit <Del> or <F1> to enter BIOS/computer configuration settings

Quickly hitting the Del or F1 button (or other button stated in the message) will get you in your BIOS setup.

From there you search for powermanagement and disable it(as it can comptete with windows powermanagent and it could be handled by windows alone), like
http://www.tomshardware.com/reviews/bios-beginners,1126-8.html

After this go back to the main main of the bios (usually ESC key) and choose Save Configuration or use the save button (usually F10)

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

BEWARE: do not change any other settings in the BIOS!!!, especially if you are unfammiliar with them or inexperienced in navigating through the BIOS settings.

If you suspect you accidentaly changed a value in another settings menu, go to the main menu and CHOOSE:
- EXIT WITHOUT SAVING
or choose EXIT and say NO if it prompted the question SAVE CONFIGURATION FILE (Y/N) ?

It is recommended that you have a usermanual of your pc close at hand, describing the various options in the BIOS menu if you decide to play with them/ optimize your pc.

In the worst case scenario, if the computer/windows doesn't work properly after changing several BIOS settings, you could restart the pc, go to the BIOS and choose LOAD FACTORY DEFAULT or OPTIMISED SETTINGS and save your BIOS again.


No absolute guaranty that it will get rid of the keyboard initiated flashing, but Disabling BIOS controlled powermanagent is a save and common practice in troubleshooting windows powermanagement / wakeup events..


Last edited by Scratch on Tue Mar 16, 2010 12:27 am; edited 1 time in total
Back to top
View user's profile Send private message
corelle
Guest





PostPosted: Tue Mar 16, 2010 12:24 am    Post subject: Reply with quote

tnx, il try this rite now and get bak to u
Back to top
Corelle
Guest





PostPosted: Tue Mar 16, 2010 1:06 am    Post subject: Reply with quote

Sad

still does it

Disabled Power Management Bios as you said
It still flashes/blinks every time there is a key entered from the other script

i think it does that because it has no choice. If there was a way to disable keys having effect on a ScreenSaver or a Turned off monitor from inactivity, it would fix my whole problem because my other script only consists of keys, no mouse movement. So if there was a way to set my computers activity triggers only for the mouse then it probably wouldn't flash/blink.

Thanks for the help Smile
Back to top
Scratch



Joined: 22 Jan 2009
Posts: 72

PostPosted: Tue Mar 16, 2010 2:00 am    Post subject: Reply with quote

Well, it was worth a try....

Perhaps another try is to send the keys using the SENDPLAY methode (look in AHK helpfile for full description) as it doesn't simulate keyboard presses, but system messages instead, if the flashing indeed be keyboard related, perhaps sendplay could circumvent that.
Back to top
View user's profile Send private message
None



Joined: 28 Nov 2009
Posts: 3086

PostPosted: Tue Mar 16, 2010 2:23 am    Post subject: Reply with quote

When I said
Quote:
Did you try increasing the check frequency (need to change the value in the if also)?
I meant for you to make
Code:
F1::SetTimer, IdleCheck, 100 ;This number
F2::SetTimer, IdleCheck, Off

IdleCheck:
If(A_TimeIdle<100) ;and this number smaller
SendMessage,0x112,0xF170,2,,Program Manager
Return

Esc::ExitApp

This is supposed to take advantage of the time it takes for the screen to turn on and turn it back off again before it finishes (CRT's are Way slower).
Back to top
View user's profile Send private message
Display posts from previous:   
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