Avoid screen off

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Avoid screen off

Post by Marco N » 02 Aug 2023, 09:11

Hi, I'm searching for a way to avoid screen off. I have tried this script belowe but unsucessfully
Thanks for any help.

Code: Select all

SetTimer, MoveMouse, 60000 ; Run MoveMouse every 1 minute

MoveMouse:
    MouseMove, 1, 0, 1, R  ;Move the mouse one pixel to the right
    MouseMove, -1, 0, 1, R ;Move the mouse back one pixel
return
[Mod edit: [code][/code] tags added.]
[Mod edit: Moved topic to AHK v1 help (from v2 help), since this is not v2 code.]


RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Avoid screen off

Post by RussF » 02 Aug 2023, 12:49

Or...
Windows->Settings->System->Power & sleep->Screen->When plugged in, turn off after->Never
Windows->Settings->System->Power & sleep->Sleep->When plugged in, PC goes to sleep->Never

Russ

Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Re: Avoid screen off

Post by Marco N » 04 Aug 2023, 04:46

Sorry for my late reply and the error on where post the answer, and thanks for your help. I have a limited access to PC so I'can't change some settings. I try to undestrand #Persistent command.

Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Re: Avoid screen off

Post by Marco N » 09 Aug 2023, 03:28

I have tried in this way but it doesn't work:

Code: Select all

#Persistent
SetTimer, MoveMouse, 60000 ; Run MoveMouse every 1 minute

MoveMouse:
    MouseMove, 1, 0, 1, R  ;Move the mouse one pixel to the right
    MouseMove, -1, 0, 1, R ;Move the mouse back one pixel
return

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Avoid screen off

Post by mikeyww » 09 Aug 2023, 05:46

These are not physical actions. My general understanding is that physical actions might be necessary in some situations where the monitor is set to shut off automatically.

Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Re: Avoid screen off

Post by Marco N » 09 Aug 2023, 07:01

You mean there are no solutions to the problem?

User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Avoid screen off

Post by mikeyww » 09 Aug 2023, 07:04

Perhaps: https://www.autohotkey.com/boards/viewtopic.php?style=17&t=95857

If needed, search the forum for other potential solutions.

Post Reply

Return to “Ask for Help (v1)”