Jump to content

My Shift and Control keys get stuck sometimes during scripts


Recommended Posts

I have a script that remaps part of my keyboard:

#Include <Misc.au3> 

HotKeySet("E", "EKey")

Func EKey()
Send("{BACKSPACE}")
Send("=")
Send("-")
Send("7")
Send("-")
EndFunc

$dll = DllOpen("user32.dll") 
While 1     
    Sleep (10)     
        If _IsPressed("57", $dll) Then         
            Send("{, down}")         
            Send("{. down}")         
            While _IsPressed("57", $dll)             
                Sleep(10)         
            WEnd         
            Send("{, up}")         
            Send("{. up}")     
        EndIf 
WEnd

It works great 99% of the time. However, sometimes after using certain combinations the shift or control or alt keys will get stuck down.

I think it's because I have some hotkeys that are like Send("!\") in other hotkey'd functions. Is there some proper way to use the ! ^ and + send controls so that they don't screw up and hold down the shift/alt/control keys so you have to mash them on your keyboard to get them to unstick?

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