pixelsearch Posted May 8, 2018 Posted May 8, 2018 Hi everybody When I use HotkeySet for the Escape key, the script usually works fine if the User presses Esc (he is asked to confirm if he wants to quit or not) But in some scripts containing lines like Send("^a") or Send("^c") or Send("^v") then, if the user presses Esc, Windows sometimes "grabs" the control key, adds to it the Esc key and opens the Start Menu (which normally appears if you type ctrl+escape), ending in a total mess. The only solution I found was not to use Esc as Hotkey in scripts where the control key is "sent", using instead for instance F5 as Hotkey to ask if you want to quit, but F5 is much less intuitive, though it will work perfectly as Hotkey in scripts containing Send commands containing ctrl+a ctrl+c etc... Another option would be to disable the Control+Escape in those scripts but I dont know how to do this. Does any of you found the same issue when you use HotKeySet("{Esc}", "QuitOrNot") in a script containing Send commands which use the control key ? Thanks in advance "I think you are searching a bug where there is no bug... don't listen to bad advice."
noobieautolearn Posted May 8, 2018 Posted May 8, 2018 (edited) I'm thinking what you should do is set the hotkey ctrl+esc to be terminate but I don't know the syntax to do that but I feel like someone should know it. For example HotKeySet("{ESC}", "Terminate") is what you have right? Something like one of below. HotKeySet("{ctrl+ESC}", "Terminate") HotKeySet("{ctrl}+{ESC}", "Terminate") HotKeySet("{ctrl}{ESC}", "Terminate") Edited May 8, 2018 by noobieautolearn
aa2zz6 Posted May 8, 2018 Posted May 8, 2018 I have my scripts set with F5 to Start / Stop & F4 to pause. Using ESC became annoying and It's pointless having to use more than 1 key to incorporate the ESC key to end a script for me
pixelsearch Posted May 8, 2018 Author Posted May 8, 2018 Thanks guys for your quick answers, as it's the 1st time I post here. Unfortunately, noobieautolearn's suggestion didn't work, even when I try this in the same script : HotKeySet("{ESC}", "QuitOrNot") HotKeySet("^{ESC}", "QuitOrNot_2") Windows stills opens the Start Menu, from time to time, when the user types Esc to quit. The problem seems even worse as I'm digging into it : even without ANY KeySet, if a script contains many Send("^a") or Send("^c") or Send("^v"), then if the user presses the Esc Key a few times while the script is running, Windows will simulate a ctrl+Esc and opens the Start Menu, which creates big issues as the script continues running in a wrong Window. So my issue doesn't seem to be related to the HotKeySet at all. Sorry I opened this thread with this bad title. The only solution to avoid this issue seems to deactivate Ctrl+Escape, through the Registry or using a 3rd-party program. Now I'll keep searching a solution to deactivate totally Ctrl+Escape while AutoIt is running "I think you are searching a bug where there is no bug... don't listen to bad advice."
aa2zz6 Posted May 8, 2018 Posted May 8, 2018 33 minutes ago, pixelsearch said: Thanks guys for your quick answers, as it's the 1st time I post here. Unfortunately, noobieautolearn's suggestion didn't work, even when I try this in the same script : HotKeySet("{ESC}", "QuitOrNot") HotKeySet("^{ESC}", "QuitOrNot_2") Windows stills opens the Start Menu, from time to time, when the user types Esc to quit. The problem seems even worse as I'm digging into it : even without ANY KeySet, if a script contains many Send("^a") or Send("^c") or Send("^v"), then if the user presses the Esc Key a few times while the script is running, Windows will simulate a ctrl+Esc and opens the Start Menu, which creates big issues as the script continues running in a wrong Window. So my issue doesn't seem to be related to the HotKeySet at all. Sorry I opened this thread with this bad title. The only solution to avoid this issue seems to deactivate Ctrl+Escape, through the Registry or using a 3rd-party program. Now I'll keep searching a solution to deactivate totally Ctrl+Escape while AutoIt is running You could look at incorporating AdlibRegister to run a function like WinActivate every x-amount of time so that the window is always on top.
pixelsearch Posted May 8, 2018 Author Posted May 8, 2018 Thanks aa2zz6 for your input, I'll try it for sure Yesterday I tried the AutoIt instruction SendKeepActive(...) which helped a bit, it "attempts to keep a specified window active during Send()." (help file) 5 min ago, after having read a web page, I just tried a simple AutoHotkey script, which totally disables Ctrl+Escape ^Escape:: Return This one seems to work fine, nothing happens anymore when you press ctrl+ escape, no more Start Menu, yes ! And it seems that my AutoIt issue is solved now. So I'll leave the little AutoHotkey script running continually in the background while AutoIt is running : now I can use again the Esc HotKeySet without having the Start Menu interfering when pressing Escape "I think you are searching a bug where there is no bug... don't listen to bad advice."
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