Jump to content

Recommended Posts

Posted

Dim $ret, $a_keystate[4]
While 1
$KeyStates = _GetKeyState()
For $i = 1 to $KeyStates[0]
    ConsoleWrite($KeyStates[$i] & @LF)
Next
WEnd

Func _GetKeyState()
    Const $VK_NUMLOCK = 0x42
    Const $VK_SCROLL = 0x43
    Const $VK_CAPITAL = 0x41
    $a_keystate[0] = 3
    $ret = DllCall("user32.dll", "long", "GetKeyState", "long", $VK_NUMLOCK)
    $a_keystate[1] = $ret[0]
    
    $ret = DllCall("user32.dll", "long", "GetKeyState", "long", $VK_SCROLL)
    $a_keystate[2] = $ret[0]

    $ret = DllCall("user32.dll", "long", "GetKeyState", "long", $VK_CAPITAL)
    $a_keystate[3] = $ret[0]

    Return $a_keystate
EndFunc ;==>_GetKeyState

This works for me.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...