Code: Select all
if GetKeyState("CapsLock", "T")
{
scW:=A_ScreenWidth-20
scH:=A_ScreenHeight-20
Gui, color, 000000, Light Blocking GUI
Gui, -Caption +AlwaysOnTop +E0x08000000 +owner
Gui, show, x10 y10 w%scW% h%scH%, Light Blocking GUI
WinSet, Transparent, 0, Light Blocking GUI
SetCapsLockState, off
}
else
{
scW:=A_ScreenWidth-20
scH:=A_ScreenHeight-20
Gui, color, 000000, Light Blocking GUI
Gui, -Caption +AlwaysOnTop +E0x20 +owner
Gui, show, x10 y10 w%scW% h%scH%, Light Blocking GUI
WinSet, Transparent, 100, Light Blocking GUI
SetCapsLockState, on
}
return
I've assembled the above code to dim the screen when I press the CAPS LOCK button - and brighten it again on the second press. However, pressing CAPSLOCK causes Windows to lose the focus of the window I'm working on. I've tried adding the No Activation option to the Gui command but to no effect.
Needless to say this code is to be used as a capslock indicator. I've tried tool tips and progress bars, but I need something big and obvious and the progress bar for one doesnt allow click through which makes it very annoying if its in the wrong place on the screen.
Any ideas?
Thanks for any help.