Sign in to follow this  
Followers 0
Guest mjkroll

NumLock detection

8 posts in this topic

Can AutoIt detect Num/Scroll/Caps Lock status?

My script needs to know if they're on or off, and

it's not sufficient to send("{NUMLOCK on}").

In case it's relevant, I'm using WinXP Pro.

Thanks much.

Share this post


Link to post
Share on other sites



There's no way to do that from within AutoIt. You might search for 3rd party tools, because I have seen apps before that detect the lock state and change their display accordingly. It's just a matter of finding one that does what you need.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

I think I remember AutoHotKey doing this.


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Maybe we will in a later Autoit have a function like "KeyGet" to get/set directly these special keys.... :lol:

we will see later in this evening... :(:ph34r:

Edit: made a small function KeyLockState which returns the state (0/1 -> Off/On) of the keys "CAPSLOCK", "NUMLOCK" and "SCROLLLOCK" (small letters are no problem).

I will later post it into the "IdeaLab"-section to the GUISetControlProperty-Page...

Holger :lol:

Edited by Holger

Share this post


Link to post
Share on other sites

Thank you, Holger!

KeyLockState is just what I needed. :ph34r:

Share this post


Link to post
Share on other sites

would it be possible to use something like this?

dont know how to check if numlock is on or of or if its even possible... thanx in advance for any help

While 1

If Not $pause And "{NUMLOCK off}" Then

TrayTip("Paused!!!", "Tip", 5, 16)

$pause = 1

ElseIf $pause And "{NUMLOCK on}" Then

$pause = 0

TrayTip("Not Paused", "Tip", 5, 16)

ElseIf $pause = 1 Then

Sleep(100)

Else

CODE HERE

Share this post


Link to post
Share on other sites

would it be possible to use something like this?

...

<{POST_SNAPBACK}>

No. First of all, it's not doable right now within AutoIt. Second, any string that is not blank evaluates to 0. That means that using If "string" will be false, and has no bering what-so-ever on the state of the light.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

ok thanx for the answer... had the feeling it wasnt possible but u might as well ask :ph34r:

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  
Followers 0