Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Another On-Screen Caps Lock Indicator


  • Please log in to reply
2 replies to this topic
TuxRocks
  • Members
  • 2 posts
  • Last active: Feb 07 2014 03:43 PM
  • Joined: 22 Jan 2014

One of our corporate user's always had trouble with knowing whether Caps Lock was on or off when typing in passwords.  Like many new keyboards, his does not have the state indicator lights.  He monitors many different accounts and types in many passwords everyday, so having an indicator was very helpful.  I've decided to share this script in hoping that it helps someone else.  Let me know if you have suggestions!

SetCapsLockState, Off
width := A_ScreenWidth - 202
height := A_ScreenHeight - 70

~*CapsLock::

Sleep, 100
if GetKeyState("CapsLock", "T")
{
	Progress, B1 W200 H28 ZH0 FS11 WS900 x%width% y%height% CTFF0000, CAPS LOCK ON
}
else
{
	Progress, off
}

return


chaz
  • Members
  • 192 posts
  • Last active: Oct 01 2015 02:42 AM
  • Joined: 26 Mar 2013
I like it! Short and to the point. I use a similar script that pops up a tooltip every time any of the lock keys are pressed. I'll post it here. It would also be pretty easy to modify it to, say, stay up until Caps Lock is turned off, or have it turn off automatically after five minutes.
 
;=============================================================================================
; Show a ToolTip that shows the current state of the lock keys (e.g. CapsLock) when one is pressed
;=============================================================================================
~*NumLock::
~*CapsLock::
~*ScrollLock::
Sleep, 10	; drastically improves reliability on slower systems (took a loooong time to figure this out)

msg := "Caps Lock: " (GetKeyState("CapsLock", "T") ? "ON" : "OFF") "`n"
msg := msg "Num Lock: " (GetKeyState("NumLock", "T") ? "ON" : "OFF") "`n"
msg := msg "Scroll Lock: " (GetKeyState("ScrollLock", "T") ? "ON" : "OFF")

ToolTip, %msg%
Sleep, 250	; SPECIFY DISPLAY TIME (ms)
ToolTip		; remove
return

Find me at the other forum as timeFlies.


TuxRocks
  • Members
  • 2 posts
  • Last active: Feb 07 2014 03:43 PM
  • Joined: 22 Jan 2014

That's really cool!!  Never thought to make it pop up in a tooltip, but I like it.