Turk22 Posted 3 hours ago Posted 3 hours ago expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=MicroageNetworks.ico #AutoIt3Wrapper_Outfile=Test.exe #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** AutoItSetOption("MouseCoordMode", 1) ; 0=Relative to Active Window, 1=Absolute Screen 2=Relitive to Client Area AutoItSetOption("MustDeclareVars", 1) AutoItSetOption("WinTitleMatchMode", 2) ; match any substring in title #include-once Opt("TrayMenuMode", 1) #include <C:\Program Files (x86)\AutoIt3\Include\MsgBoxConstants.au3> ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False Global $Count1 = 0, $Count2 = 0 HotKeySet("{PAUSE}", "HotKeyPressed") HotKeySet("{ESC}", "HotKeyPressed") HotKeySet("!1", "HotKeyPressed") HotKeySet("!2", "HotKeyPressed") While 1 Sleep(1000) WEnd Func HotKeyPressed() Switch @HotKeyPressed ; The last hotkey pressed. Case "{PAUSE}" ; String is the {PAUSE} hotkey. $g_bPaused = Not $g_bPaused While $g_bPaused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") Case "{ESC}" ; String is the {ESC} hotkey. Exit Case "!1" $Count1 = $Count1 + 1 Send("The number one was pressed" & " (" &$Count1 & ")") Case "!2" $Count2 = $Count2 + 1 Send("The number two was pressed" & " (" &$Count2 & ")") EndSwitch EndFunc ;==>HotKeyPressed Well..... I use to be heavy into AutoIT but it was maybe 15 years ago. I am trying to start again and right off the bat am getting clobbered. The above code is pulled directly from the forum. What it does is very, very odd. When I press Alt-1 it will initially miss the first character the first time. Then go into a loop displaying the text twice omitting the counter two times then continue in the infinite loop displaying the counter. Eventually it will mix up my mouse buttons, lay down odd graphic characters in Notepad and make the computer unusable to the point all I can do is reboot. This was a pretty simple project. Any ideas why it freaks out? On kind of a side note I would much rather use the function keys. It is a wireless keyboard and mouse and the function keys are "hard coded" to do thinks like volume up and down, calculator, etc. Is there any way to over ride the "hard coded" things so I can use the function keys in this program?
Nine Posted 3 hours ago Posted 3 hours ago (edited) Well Send is also interpreted as a HotKeySet (same as if you would type on the keyboard). You could use ControlSend instead or disable the HotKeySet while you send something. Moreover, many applications (like Notepad) use Alt to show menu and execute shortcut keys. Choosing Alt-1/Alt-2 may interfere with the application. Edited 3 hours ago by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Turk22 Posted 2 hours ago Author Posted 2 hours ago Shoot. I started out assuming that send did a keypress just by watching it so I switched it to ALT. Using Ctrl did much, much better. It at least laid down the entire line and counter like it should have. The problem with scrambling the computer still existed. After about 6 uses it essentially disabled the keyboard in Chrome among other oddities. The quit on esc quit working and the only thing I could do is reboot. I would much rather use the function keys but as mentioned these wireless keyboards have re-assigned the function keys to other things and I can't find a way to get around that.
Nine Posted 1 hour ago Posted 1 hour ago (edited) The Alt (or Ctrl) key may be stuck. Look in the wiki, there is a topic around that. As for the function (Fn buttons, not the F1, F2, etc) keys, you cannot use HotKeySet. I did manage to intercept some of those keys with my Debug Messages Monitor UDF. It may work or may not. But it is way more complicated ! Edited 1 hour ago by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Turk22 Posted 1 hour ago Author Posted 1 hour ago I switched to Ctrl-Alt-1 and Ctrl-Alt-2. Much better but when I stop the program a double left mouse click (to run it) on my desktop icons opens up the properties of the icon and will not run it. It was such a simple program LOL!
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