Here is my problem:- Everything is fine with the script. BUT. The monitor reactivates when I move my mouse. I thought this would be prevented by blockinput, mousemove but that apparently does not work (blocks mouse-movements, but hardware mouse-movements still reactive the monitor). How do I prevent mouse-movements from my hardware mouse from turning my screen back on? I'm not using the keyboard in this just the mouse. And I need the rest of the mouse buttons if that somehow plays as a factor.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Blockinput, mousemove
;Disables mouse-movements when script is active
Number = 1
;value for toggling monitor
LButton & Rbutton::
Number++
Suspend, On
Sleep 2000
Suspend, Off
;suspend to make sure the script triggers only once
If (Mod(Number, 2) = 0) ; if even
{
SendMessage, 0x112, 0xF170, 2,, Program Manager
}
;turn off monitor
Else
{
SendMessage, 0x112, 0xF170, -1,, Program Manager
}
;turn on monitor
return