BatMan22 Posted September 9, 2017 Share Posted September 9, 2017 (edited) I am using autoit, and the generated EXE's on an older machine with Windows XP, and am having a problem with Keyboard keys getting 'stuck' when the program uses them. IE. If I tell the computer to Send("!ED" & "{Down}{Right}") Send($sText & $sAppend) Sleep(100) Then ~50% of the time, when I come to use the computer, the computer acts like the Alt Key is being held down. Even after the program is finished running, and the way to 'unstuck' it is by actually physically hitting the button on the keyboard. I have a feeling that autoit 'trigger' the alt key so fast that it doesn't register when it 'un-triggers' it. Is there anything I can end the program with that would clear that stuckness? Is there a way to tell autoit to "slowly press the alt key for .5 seconds" and then let go? Also sometimes the shift button gets stuck the same way. Or is there a way to specially compile the programs for older XP builds that sends the special keys that are held down a little slower? Edited September 9, 2017 by BatMan22 Link to comment Share on other sites More sharing options...
Simpel Posted September 9, 2017 Share Posted September 9, 2017 Hi. Look at this thread in AutoIt wiki: https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F Conrad BatMan22 1 SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
BatMan22 Posted September 11, 2017 Author Share Posted September 11, 2017 On 9/9/2017 at 0:49 AM, Simpel said: Hi. Look at this thread in AutoIt wiki: https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script.3F Conrad Thanks buddy, you rock! Fixed my issues. Link to comment Share on other sites More sharing options...
BatMan22 Posted September 28, 2017 Author Share Posted September 28, 2017 Hey guys.. Turns out my issues AREN'T fixed, I still get stuck keys everytime I run my programs.. Example Below, I don't understand why the 'General Fix Method' isnt working for me. And the "Keys virtually stuck" fix, I don't understand how to impliment.. Help? I've even tried having every other damn line be the 'fix' listed, and yet it still seems to get stuck and makes my program fail in navigating the menus as well. expandcollapse popup;Combine Different functions Cut Left, Cut Right and Select Peak, Report Repeat Up, And Report Single and run in background. HotKeySet ( "^!a" , "CutLeft" ) ;HotKeySet ( "^!s" , "CutRight") ;HotKeySet ( "^!z" , "ReportSingle") ;HotKeySet ( "^!u" , "ReportRepeatUp") ;HotKeySet ( "^!z" , "ReportSingle") Func CutLeft() ControlSend("", "", "", "text", 0) Sleep(50) Send("!ep"); send to batch ControlSend("", "", "", "text", 0) Sleep(250) Send("!e"); send to batch ControlSend("", "", "", "text", 0) Sleep(500) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(40) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(40) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(40) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(40) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(40) Send("{DOWN}") ControlSend("", "", "", "text", 0) Sleep(2000) ;if 148,157 is 0x000080 then continue otherwise exit ;MouseClick("primary", 147, 157) Local $aCoord = PixelSearch(147, 157, 148, 158, 0x000080) ; search for blue in menu If @error Then MsgBox(0, "Error", "Program moved too fast or not fullscreen or FML.") EndIf ControlSend("", "", "", "text", 0) Send("{enter}") ControlSend("", "", "", "text", 0) Sleep(50) Send("!e") ControlSend("", "", "", "text", 0) Sleep(40) Send("l") ControlSend("", "", "", "text", 0) Sleep(40) ControlSend("", "", "", "text", 0) EndFunc While True Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
BatMan22 Posted September 28, 2017 Author Share Posted September 28, 2017 Ignore my question, I didn't understand that the _SendEx would fix the problem.. I thought it would just give a warning. I *think* it's fixed, but that ControlSend("", "", "", "text", 0) thing is useless. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now