Jump to content
supraspecies

Can't shut down CapsLock

Recommended Posts

supraspecies

I use  

Send("{CapsLock off}")

I just started writing a script, and immediately faced a problem. I need to turn off CapsLock key. I can not shut off CapsLock button. Try it - the button LED will  flash, but it sure as Hell won't turn off. Ive tried everything. So how do I shut the damned thing on or off? It's either beyond my current skills, or I missed something.

 

 

Share this post


Link to post
Share on other sites
badcoder123
$WshShell = ObjCreate("WScript.Shell")
$WshShell.SendKeys("{CAPSLOCK}")

;)

Share this post


Link to post
Share on other sites
alienclone

or set option at start of script..

Opt("SendCapslockMode", 0) ;1=store and restore, 0=don't

then your send capslock on/off/toggle will work

  • Like 1

if @error Then
	MsgBox(262192,"",@ComputerName&" slaps "&@UserName&" around a bit with a large trout!")
	EndIf

>Exit code: 0

REAL search results

"Yeah yeah patience, how long will that take?"  -Ed Gruberman

Share this post


Link to post
Share on other sites
supraspecies
19 minutes ago, badcoder123 said:
$WshShell = ObjCreate("WScript.Shell")
$WshShell.SendKeys("{CAPSLOCK}")

;) Above my level... Eager to learn. I can see it triggers CapsLock On and Off, but how do i modify it to only trigger Caps Lock Off?

 

Share this post


Link to post
Share on other sites
supraspecies
31 minutes ago, alienclone said:

or set option at start of script..

Opt("SendCapslockMode", 0) ;1=store and restore, 0=don't

then your send capslock on/off/toggle will work

Your method worked like a charm, thank you very much. And thank you, badcoder123 that was a really neat small piece of code.!

Share this post


Link to post
Share on other sites
badcoder123
44 minutes ago, supraspecies said:

 

#include <WinAPIvkeysConstants.au3>
#include <WinAPISys.au3>
Opt("SendCapslockMode", 0)

Send("{CapsLock}")
$_Status = _WinAPI_GetKeyState($VK_CAPITAL)
ConsoleWrite($_Status)

This will tell you if it's on or off... Now it's just a case of you inserting an If statement. :)

Edited by badcoder123

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

×