Alchemist Posted March 17, 2010 Posted March 17, 2010 hi all HotKeySet("!0","testfunc") HotKeySet("!1","ExitProgram") while 1 sleep(100) WEnd func testfunc() send("abcdef") EndFunc Func ExitProgram() Exit EndFunc Run this script. Open notepad for example. Press quickly several times Alt+0. After that Alt key remains held down sometimes. Any ideas?
JohnOne Posted March 17, 2010 Posted March 17, 2010 Well you have to employ common sense. Give a function time to finish before you call it again. I know there is nothing common about sense, but two birds one stone and all that. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Fulano Posted March 17, 2010 Posted March 17, 2010 Actually, I've had this kind of thing happen w/o spamming the function. I have a function that grabs the selection via the clipboard and occasionally the Ctrl key will get stuck. Interestingly enough, calling the function directly rather than by HotKey does not exhibit this behavior. #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!
JohnOne Posted March 17, 2010 Posted March 17, 2010 Actually, I've had this kind of thing happen w/o spamming the function. I have a function that grabs the selection via the clipboard and occasionally the Ctrl key will get stuck. Interestingly enough, calling the function directly rather than by HotKey does not exhibit this behavior.I have noticed this problem a couple of times, it is always from a function that has no return, and getting hammered by a spam etc...I cant say why you are having your problems though sorry. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Fulano Posted March 17, 2010 Posted March 17, 2010 ::shrugs:: It doesn't happen when called by my function (which is the only time it could cause any real damage), so it's been classed in my head as a low-priority bug. #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!
martin Posted March 17, 2010 Posted March 17, 2010 ::shrugs::It doesn't happen when called by my function (which is the only time it could cause any real damage), so it's been classed in my head as a low-priority bug.The problem is very well known. You have a hotkey which calls a function which uses Send. Send starts sending characters before the keys for the hotkey have been released and that screws up the state of the keys. One solution is to add something in the function called to wait untill the hot keys have been released.It's in FAQ item 19. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Fulano Posted March 17, 2010 Posted March 17, 2010 Martin receives the ball, cuts past the defender and lobs one right into the middle of the FAQ: GoooOOOOOOooooOOOOOoooaaaaaAalll! Seriously, how did I miss that? #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja!
Alchemist Posted March 18, 2010 Author Posted March 18, 2010 Thanks martinThanks all_SendEx function solves the problem.The problem is very well known. You have a hotkey which calls a function which uses Send. Send starts sending characters before the keys for the hotkey have been released and that screws up the state of the keys. One solution is to add something in the function called to wait untill the hot keys have been released.It's in FAQ item 19.
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