Request for Support: I modified the following AutoHotkey script (found within the forum) to set the CapsLock Key to the "On" position for a db table (PhD research project) that I am working on. The CapsLock key is disabled in the "On" position using this script, which is desirable; however, no matter how long the CapsLock Key is depressed (I am using Win7), the script functionality is not broken and I must exit AutoHotkey to return the CapsLock Key to a normal on-off toggle state.
I would appreciate any suggested modifications re the script below with regard to breaking the script "ON" loop if the CapsLock key is depressed from more than a few seconds. I am a new new forum user/novice programmer and while I am sure that the scripting solution is a simple matter, I am at a loss as to how best to modify the script code further to accomplish the program break sequence. Advice or suggestions would be appreciated.
;Disable modified Caps Lock Key Script
*CapsLock::Return
;Hold Caps Lock for approximately 1 second to enable, tap to disable
CapsLock::
{
SetCapsLockState, On
Return
}
Count=0
While GetKeyState("CapsLock", "P")
{
Count++
Sleep, 1
If Count > 5
{
Send, {CapsLock}
Break
}
}
KeyWait, CapsLock
Return