AutoHotKey Script: CapsNumLockOSD

This script shows OSD (On Screen Display) to indicate current keyboard state when CapsLock/NumLock key is pressed.
This could be quite convenient if your laptop doesn’t have dedicated LED indicators for CapsLock/NumLock.
PS:
If you toggle the CapsLock/NumLock repeatedly, the OSD will also update in realtime correspondingly. The OSD will disappear automatically after 2 seconds.

; Show CapsLock/NumLock state on screen display

~*CapsLock::
if GetKeyState("CapsLock", "T")
	Progress, B1 W200 H28 ZH0 FS11 WS900 Y700 CTFF0000, CAPS LOCK ON
else
	Progress, B1 W200 H28 ZH0 FS11 WS900 Y700 CT0000FF, CAPS LOCK OFF
SetTimer, OSD_OFF, -2000
Return

~*NumLock::
if GetKeyState("NumLock", "T")
	Progress, 0 B1 W200 H28 ZH0 FS11 WS900 Y700 CTFF0000, NUM LOCK ON
else
	Progress, 0 B1 W200 H28 ZH0 FS11 WS900 Y700 CT0000FF, NUM LOCK OFF
SetTimer, OSD_OFF, -2000
Return

OSD_OFF:
Progress, off
Return
Advertisements

About AyuanX

Big Brother is watching you! Yes, you!
This entry was posted in 個人用途 and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s