Below is the code I've gleened / grafted from the awesome people around these parts.
I have two things I can't work out.
1) How do you make this Gui so that it does not take any focus from any window, anywhere, at any time?
2) How do I get these subscripts to activate upon a caps lock state toggle? The second code window is a script I use to totally surrender control of caps lock. (Currently enjoying telling anyone who'll listen that I'm too lazy to hit the Caps Lock Key!) Do I somehow have to combine the two scripts? Or can I make the top one detect a caps lock state toggle and apply the images I've created?
Code: Select all
SetWorkingDir %A_ScriptDir%
CapsSplash:
CapsState := GetKeyState("CapsLock", "T")
IfEqual, CapsState, 0
{
Gui, add, picture, , caps-off.png
gosub, SplashCaps
}
CapsState := GetKeyState("CapsLock", "T")
IfEqual, CapsState, 1
{
Gui, add, picture, , CAPS-ON.png
gosub, SplashCaps
}
return
SplashCaps:
Gui, Color, FFFFFF
Gui, -LastFound
Winset, Transcolor,FFFFFF
Gui, -Caption +Alwaysontop
Gui, Show
Sleep, 475
Gui, Destroy
return
Code: Select all
#Persistent
SetTimer, WinActive, 500
return
WinActive:
WinGet, ActiveProcess, ProcessName, A
If ActiveProcess Contains acad,excel,notepad
{
GetKeyState, CapsOnOff, CapsLock, T
IfEqual, CapsOnOff, On
{
return
}
else
{
SetCapsLockState, On
return
}
}
WinGet, ActiveProcess, ProcessName, A
If ActiveProcess Contains Inventor
{
WinGetTitle, ActiveTitle, A
If ActiveTitle = Format%A_Space%Text
{
GetKeyState, CapsOnOff, CapsLock, T
IfEqual, CapsOnOff, On
{
return
}
else
{
SetCapsLockState, On
return
}
}
WinGetTitle, ActiveTitle, A
If ActiveTitle = Edit%A_Space%Dimension
{
GetKeyState, CapsOnOff, CapsLock, T
IfEqual, CapsOnOff, On
{
return
}
else
{
SetCapsLockState, On
return
}
}
}
GetKeyState, CapsOnOff, CapsLock, T
IfEqual, CapsOnOff, Off
{
return
}
else
{
SetCapsLockState, Off
return
}
return