Jump to content

How to NUMLOCK / CAPSLOCK / SCROLLOCK OFF?


Dirk98
 Share

Recommended Posts

Send("{NUMLOCK off}")
Send("{CAPSLOCK off}")
Send("{SCROLLLOCK off}")

:)

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Send("{NUMLOCK off}")
Send("{CAPSLOCK off}")
Send("{SCROLLLOCK off}")
Just to clarify, it does not diasable the keys, it justs sets the state to off. If someone presses one of the keys they will switch state.

To set the state of the capslock, numlock and scrolllock keys

Send("{NumLock on}") ;Turns the NumLock key on

Send("{CapsLock off}") ;Turns the CapsLock key off

Send("{ScrollLock toggle}") ;Toggles the state of ScrollLock

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

Just to clarify, it does not diasable the keys, it justs sets the state to off. If someone presses one of the keys they will switch state.

This might work:

#include 
Send("{NUMLOCK off}")
Send("{CAPSLOCK off}")
Send("{SCROLLLOCK off}")

While 1
    Select 
        Case _IsPressed (90) = 1
            Send ("{NUMLOCK toggle}") 
        Case _IsPressed (91) = 1
            Send ("{SCROLLLOCK toggle}")
        Case _IsPressed (14) = 1
            Send ("{CAPSLOCK toggle}") 
        Case _IsPressed ('1B') = 1
            Exit
    EndSelect
WEnd
Link to comment
Share on other sites

This might work:

#include 
Send("{NUMLOCK off}")
Send("{CAPSLOCK off}")
Send("{SCROLLLOCK off}")

While 1
    Select 
        Case _IsPressed (90) = 1
            Send ("{NUMLOCK toggle}") 
        Case _IsPressed (91) = 1
            Send ("{SCROLLLOCK toggle}")
        Case _IsPressed (14) = 1
            Send ("{CAPSLOCK toggle}") 
        Case _IsPressed ('1B') = 1
            Exit
    EndSelect
WEnd

Sorry, bear with me, #Include what?

Link to comment
Share on other sites

It needs Misc.au3

It didn't work for me though...

Oh I see.. the light flashes if I keep the key pressed.. haha.

Ok... Thats weird, the #include <misc.au3> completely destroyed itself?? Meh. It theory it should have worked :) Sorry...
Link to comment
Share on other sites

It may be better to use this... it should set it back if it gets changed.

If _GetScrollLock() = 1 Then Send("{SCROLLLOCK Toggle}"); 0 = Off  /  1 = On


....


Func _GetScrollLock(); Checks to see if Scroll Lock is on
    Local $ret
    $ret = DllCall("user32.dll","long","GetKeyState","long",$VK_SCROLL)
    Return $ret[0]
EndFunc

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

It may be better to use this... it should set it back if it gets changed.

If _GetScrollLock() = 1 Then Send("{SCROLLLOCK Toggle}"); 0 = Off  /  1 = On


....


Func _GetScrollLock(); Checks to see if Scroll Lock is on
    Local $ret
    $ret = DllCall("user32.dll","long","GetKeyState","long",$VK_SCROLL)
    Return $ret[0]
EndFunc
Yes. It would :)
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...