Jump to content
Sign in to follow this  

How to determine CAPSLOCK state?

Recommended Posts


#include <Misc.au3>

Global $dll = DllOpen("user32.dll")
Global $num = DllCall("user32.dll", "long", "GetKeyState", "long", 0x90) ; NumPad
Global $rollen = DllCall("user32.dll", "long", "GetKeyState", "long", 0x91) ; Rollen
Global $capslock = DllCall("user32.dll", "long", "GetKeyState", "long", 0x14) ; Capslock
Global $tasten[3] = [$num[0], $rollen[0], $capslock[0]]
Global $string[3] = ["NumPad", "Rollen", "CapsLock"]

For $i = 0 To UBound($tasten) - 1
    If $tasten[$i] = 1 Then

Func _FunktionWennAktiv($taste)
    MsgBox(64, "A", $taste & " is activ!")
EndFunc   ;==>_FunktionWennAktiv

Func _FunktionWennNICHTAktiv($taste)
    MsgBox(64, "N", $taste & " is not aktiv!")
EndFunc   ;==>_FunktionWennNICHTAktiv

While 1
    If _IsPressed("01", $dll) Then ToolTip("Left Mouse", 0, 0, "MouseClick", 1) 
    If _IsPressed("02", $dll) Then ToolTip("Right Mouse", 0, 0, "MouseClick", 1)

So long,


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...