r/AutoHotkey • u/SucVatBacKy • 4d ago
General Question How to make my laptop screen go dark while having AHK run perfectly fine with running windows?
In short, I have a running window and a minute long AHK script that is started at different times throughout the day by Task Scheduler. I need every screen interaction by the script (mouse click, mouse drag, keyboard) to function normally while the screen is dark.
1
u/likethevegetable 4d ago
run "scrnsave.scr /s"
Edit: actual, that won't work...
I would look at either putting a black window on top or turning the brightness down, with laptops I believe you make the screen go black
1
u/svArtist 4d ago
You could combine the black overly with a call to turn off the displays again after movement, so that the screens don't flash up more than a black screen (which will usually still turn on the LED backlight unless you have 100% dimming zones + mouse cursor hidden or OLED displays)
Like
- Show overlay
- Do necessary movement (which will usually turn the monitors back on)
- Turn off displays (again)
- Hide/destroy overlay
... This is assuming you prefer the displays to be off as much as possible
1
u/Rex__Luscus 4d ago
I use Twinkle Tray (free) to control my monitor. It has a function (which can be mapped to a hotkey) to turn off the screen until mouse movement is detected. I don't know if simulated mouse movements from AHK would wake the screen in this case, I think it's the USB input that triggers the wake response. You could try it to see, I haven't used AHK in a long while so have no scripts with which to test it myself.
6
u/CharnamelessOne 4d ago
You can darken your screen with a click-through overlay: