stuck ctrl key?
-I think it might be too difficult to control the problem from happening, but how about a solution?
I've encountered the same problem.
The following code causes the Ctrl key to get stuck:
Send, \{Enter}while
Send, \ Send, {Enter}doesn't cause any problems.
Interestingly enough, the Ctrl key gets stuck only in SciTE and not in other applications.
Pressing the Ctrl key manually releases it.
suspend on
suspend off
It seems to work for me.
Everyone is having the same problem, so why is there no fix?
-I think it might be too difficult to control the problem from happening, but how about a solution?
SendMode InputThenPlay
which told the script to use SendInput for any "Send" commands I wrote and if SendInput isn't valid then to try SendPlay. The default "Send" command seems to be the problem.
It won't work for EVERY case out there, but give it a shot to see if it helps you.
I'll tray with them. Can you give more details about how to insert it into a code?
Meanwhile I leave this to watch if a key is stuck:
Settimer, EYE, 300 Return EYE: GetKeyState, state, Control if state = D { SplashImage,,b x0 y715 H20 W50 ZY0 ZX0 fs9 ct1C3DB8 cw82BD3A, CONTROL, , ,Arial SetTimer, CHEkIFupCtrl, 200 Return CHEkIFupCtrl: GetKeyState, state, Control if state = U { SplashImage, Off SetTimer, CHEkIFupCtrl, Off } Return }
I know this thread is old, but I was having the same problem, and none of the solutions really worked well for me. I'm sure SendInputThenPlay would have worked, but I needed a key delay (because Lotus Notes is insanely slow).
Here's an example of what I was using:
!l:: Send {alt}ayr ;reply all = alt+l
And I was getting intermittent problems with Control sticking, for some reason. I have fixed it completely by just waiting for Alt to be released, as follows:
!l:: ;reply all = alt+l KeyWait Alt Send {alt}ayr return
All problems eliminated. Hope this helps someone else!
Cheers
Tris.
This may be relevant for those who use Capslock as a Control replacement. I was having a horrible time with Control getting stuck after using Capslock-Control. When I looked at the key log I realized the below code seemed to be causing the problem, as pressing Capslock triggered {Ctrl downtemp} but not a corresponding release of the Control key on Capslock up. According to my research this is evidently because Windows still treats Capslock as a toggle key.
;Code that caused control key to get stuck Capslock::Control
So I did the following instead, adapted from an answer I found on a different Q&A thread:
;Code that resolved the issue $Capslock:: Send {Ctrl down} $Capslock up:: Send {Ctrl up}
I'm not sure if the $ is necessary, but so far it works and I no longer get the stuck Control key problem. It's quite a relief.
:mrgreen: I have found interesting the answers of Jahf and Another Guest.
I'll tray with them. Can you give more details about how to insert it into a code?
Meanwhile I leave this to watch if a key is stuck:
Settimer, EYE, 300 Return EYE: GetKeyState, state, Control if state = D { SplashImage,,b x0 y715 H20 W50 ZY0 ZX0 fs9 ct1C3DB8 cw82BD3A, CONTROL, , ,Arial SetTimer, CHEkIFupCtrl, 200 Return CHEkIFupCtrl: GetKeyState, state, Control if state = U { SplashImage, Off SetTimer, CHEkIFupCtrl, Off } Return }
This is a cool script. Don't you need to add #Persistent to the top!?!? (I did.)