jackhab Posted January 27, 2020 Posted January 27, 2020 Hi I created a shortcut to send my email address: HotKeySet("^{NUMPAD7}", "SendEmail") Func SendEmail() Send("address@gmail.com") EndFunc I have an issue with Ctrl not releasing after pressing CtrlNum7, the text got sent but keyboard behaves as if I'm still holding Ctrl. I tried to add Opt("SendKeyDelay", 50), and Sleep() before sending the text but it did not help. So what am I doing wrong?
Musashi Posted January 27, 2020 Posted January 27, 2020 It works for me, when i increase the Sleep inside _SendEmail() HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on HotKeySet("{ESC}", "_Exit") While True Sleep(100) WEnd Func _SendEmail() Sleep(250) ; <=== Send("address@gmail.com") ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF) EndFunc Func _Exit() ConsoleWrite("! Terminated" & @CRLF) Exit EndFunc pixelsearch 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."
Nine Posted January 27, 2020 Posted January 27, 2020 Better use this : #include <Misc.au3> HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on HotKeySet("{ESC}", "_Exit") While True Sleep(100) WEnd Func _SendEmail() While _IsPressed ("11") Sleep (100) WEnd Send("address@gmail.com") ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF) EndFunc Func _Exit() ConsoleWrite("! Terminated" & @CRLF) Exit EndFunc pixelsearch 1 “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
jackhab Posted February 2, 2020 Author Posted February 2, 2020 Great! _IsPressed is, indeed, the way to prevent "sticky" Ctrl. Thanks.
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