I'm trying to repurpose my Scroll Lock to toggle my lights and monitors in my office. When Scroll Lock is on, I want my lights and monitors to switch off (the LED indicator will be nice to see in the dark).
Here is the code, I appreciate any help.
Code: Select all
; stop AHK by pressing the PAUSE key:
; http://www.autohotkey.com/docs/commands/Suspend.htm
#NoEnv
SendMode Input
#SingleInstance ignore
#persistent
#r::Reload
#NoTrayIcon
ScrollLock:
~ScrollLock::
If GetKeyState( "ScrollLock", "T" )
{
SoundPlay, C:\Users\hayes\Storage\Tech Stuff\Butler\immediately_sir.wav
run "https://autoremotejoaomgcd.appspot.com/url-to-turn-off-lights"
sleep, 1000 ;
send, ^w ;
run "C:\Users\hayes\Storage\Tech Stuff\nircmd.exe" cmdwait 1000 monitor off"
SoundPlay, C:\Users\hayes\Storage\Tech Stuff\Notifications\mechanical-switch.wav
}
Else
{
SoundPlay, C:\Users\hayes\Storage\Tech Stuff\Notifications\mechanical-switch.wav
run "https://autoremotejoaomgcd.appspot.com/url-to-turn-on"
sleep, 3000 ;
send, ^w ;
SoundPlay, C:\Users\hayes\Storage\Tech Stuff\Butler\there_we_are.wav
}
Return