Jump to content

Recommended Posts

Posted

I need my script to shut down the above (no matter if they are on ar off) before the execution of the main rutine.

Pls advise how.

Many thanks. :)

Dirk.

Posted

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]

Posted

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

Posted

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
Posted

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?

Posted (edited)

Sorry, bear with me, #Include what?

It needs Misc.au3

It didn't work for me though...

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

Edited by Nahuel
Posted

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...
Posted

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

Posted

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 :)

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
×
×
  • Create New...