Jump to content

NumLock detection


Guest mjkroll
 Share

Recommended Posts

Guest mjkroll

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.

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Guest drizzit

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

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