Jump to content
Sign in to follow this  
rudi

Read Status of Num/Caps/Scroll Lock -

Recommended Posts

rudi

Hello,

here http://www.autoitscript.com/forum/index.ph...amp;#entry82994 GaryFrost gave us code how to read the status of NUM/CAPS/SCROLL. Is it included in the current autoit3 version? Then I miss it.

If not, it might be nice to add it as a standard builtin function?

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites
XinLu

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.

Share this post


Link to post
Share on other sites
LIMITER

Someone knows how to play with the keyboard leds ? (to make them flash) ?

Share this post


Link to post
Share on other sites
LIMITER

Srry about the off topic post :) , but thx !

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.