Jump to content

Recommended Posts

Posted

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.

 

 

Posted

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

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

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

REAL search results  |  SciTE4AutoIt3 Editor Full Version

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

 

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

Posted (edited)
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

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
  • Recently Browsing   0 members

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