NassauSky Posted October 11, 2023 Share Posted October 11, 2023 (edited) Hi All, Odd issue I haven't noticed before. Using the below code and compiling as 64-bit exe leaves the Ctrl key in the down state. Pressing Ctrl+m successfully sends keys to the active window but then the ctrl key doesn't get let up and it's acting as a multi select feature while clicking on icons one at a time on the desktop. HotKeySet("^m", "SendKeysReceived") While 1 Sleep(100) WEnd Func SendKeysReceived() Send("KeysReceived") EndFunc It doesn't have the same effect compiling as a 32-bit exe. Edited October 11, 2023 by NassauSky Changed title to not specify it being a bug Link to comment Share on other sites More sharing options...
Andreik Posted October 11, 2023 Share Posted October 11, 2023 For me this is broken also in x86 executable applications. I used this script to confirm that CTRL key get stuck. #include <Misc.au3> HotKeySet("^m", "SendKeysReceived") While 1 If _IsPressed('11') Then ConsoleWrite('Ctrl Key is down.' & @CRLF) Sleep(100) WEnd Func SendKeysReceived() Send("KeysReceived") EndFunc When the words fail... music speaks. Link to comment Share on other sites More sharing options...
NassauSky Posted October 11, 2023 Author Share Posted October 11, 2023 @Andreik Interesting. I tested your code and compiled it to 32-bit exe and the Ctrl key is up after execution. No problem. Not sure how you were viewing the consolewrite output after the script was compiled as exe. Link to comment Share on other sites More sharing options...
Andreik Posted October 11, 2023 Share Posted October 11, 2023 Compile it as CUI and run it from CMD. You can see the console output. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Solution ioa747 Posted October 11, 2023 Solution Share Posted October 11, 2023 Note: https://www.autoitscript.com/wiki/FAQ#Why_does_the_Ctrl_key_get_stuck_down_after_I_run_my_script? NassauSky 1 I know that I know nothing Link to comment Share on other sites More sharing options...
NassauSky Posted October 11, 2023 Author Share Posted October 11, 2023 @Andreik can you point me in the right direction as how you compile it as a CUI? You're not saying to create a gui in the app with an element to display the console. I'm thinking you might mean another easier or universal method. The CUI forum posts are all over the place. Link to comment Share on other sites More sharing options...
Andreik Posted October 11, 2023 Share Posted October 11, 2023 In SciTe if you press Ctrl+F7 it will popup a window that ask you how do you want to compile. Somewhere in the bottom there is a checkbox "Create CUI instead of GUI EXE". Check that box and you are done. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
NassauSky Posted October 11, 2023 Author Share Posted October 11, 2023 Thanks @Andreik, I tried Ctrl+F7 previously but it just compiles to an exe without opening a dialog. I am going to try to install the full version of Scite to test that since. I didn't like the full scite since it changes the theme. It disables line numbers, sets up vertical split for console (simple fixes) but it messes up my theme and I can't find a duplicate to the original autoit scite theme. 😕 Link to comment Share on other sites More sharing options...
Andreik Posted October 11, 2023 Share Posted October 11, 2023 Not sure about what version are you using but it's a good start to get the last one and then try again. These options are there. NassauSky 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
NassauSky Posted October 13, 2023 Author Share Posted October 13, 2023 Thanks @Andreik The Scite Lite packaged with the latest version didn't have that added feature. I had to install the full version. After installing the full Scite, I got it to work in a command console as an .exe. At first I couldn't figure out how it worked when I compiled it as A3X since I just started testing A3X to stop the annoying antivirus flagging every time I make little changes to my apps. It looks like it doesn't work if I choose CUI and run it as an a3x: "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "TestCUI.a3x" Thanks again though! Link to comment Share on other sites More sharing options...
Andreik Posted October 13, 2023 Share Posted October 13, 2023 A3x is not executable format. I think @jchd showed an example some time ago about how to deal with native ConsoleWrite() and WinAPI functions. Just search on forum and you'll find the example. NassauSky 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
NassauSky Posted October 13, 2023 Author Share Posted October 13, 2023 @Andreik Thanks again. All solved getting CUI to work outside of Scite using the more pipe after compiling a3x: "C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "TestCUI.a3x" | more 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