The code doesn't actually disable the inputs though. Some of this code I researched so I don't fully understand it.
Code: Select all
ShutDownScreen(timeAsleep)
{
Sleep 300
BlockInput, On ; Disable keyboard and mouse input (doesn't work)
Sleep, 300 ; not sleeping will make it so your keyboard input wakes up the monitor immediately
SendMessage 0x112, 0xF170, 2,,Program Manager ; send the monitor into off mode
;wait for a key to be pressed or for timer
if (timeAsleep)
Sleep, %timeAsleep%
else
Input, SingleKey, F10, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause} ; Not sure what this does, but the code I copied said 'wait for a key to be pressed'
SendMessage 0x112, 0xF170, -1,,Program Manager ; send the monitor into on mode (doesn't work: something happens to the monitor, but it goes back off after)
Sleep 300
BlockInput, Off ; Enable keyboard and mouse input
Sleep 300
Sleep, 9
MouseMove, 3, 3,,R ; This turns the monitor on
Sleep, 9
}