wangzhengbo Posted January 18, 2014 Share Posted January 18, 2014 The default value for MouseClickDownDelay is 10 milliseconds. Is it means after call AU3_MouseDown it will delay 10 milliseconds? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 18, 2014 Share Posted January 18, 2014 I believe that it is how long the mouse button will be held down. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 18, 2014 Share Posted January 18, 2014 And after a look in the Help file, here's the quote - Alters the length a click is held down before release. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
wangzhengbo Posted January 18, 2014 Author Share Posted January 18, 2014 And after a look in the Help file, here's the quote - Alters the length a click is held down before release. I can't understand the note "Alters the length a click is held down before release." in the help file. Is it means when i run something like below: var startTime = getTime(); AU3_MouseDown(); var endTime = getTime(); then (endTime - startTime) >= 10? Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 18, 2014 Share Posted January 18, 2014 It works like this. 1. AutoIt simulates pushing the mouse button down 2. AutoIt waits MouseClickDownDelay milliseconds 3. AutoIt simulates letting the mouse button back up Link to comment Share on other sites More sharing options...
wangzhengbo Posted January 19, 2014 Author Share Posted January 19, 2014 It works like this. 1. AutoIt simulates pushing the mouse button down 2. AutoIt waits MouseClickDownDelay milliseconds 3. AutoIt simulates letting the mouse button back up See example below: expandcollapse popupimport java.io.File; import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.WString; public class MouseDownDemo { public static void main(String[] args) { System.load(new File("AutoItX3.dll").getAbsolutePath()); AutoItX autoItX = (AutoItX) Native.loadLibrary("AutoItX3", AutoItX.class); System.out.println("Default value for MouseClickDownDelay is: " + autoItX.AU3_Opt(new WString("MouseClickDownDelay"), 10)); long start = System.currentTimeMillis(); autoItX.AU3_MouseDown(new WString("left")); long end = System.currentTimeMillis(); autoItX.AU3_MouseUp(new WString("left")); System.out.println("end - start = " + (end - start)); System.out.println(); // Change MouseClickDownDelay to 1 second System.out.println("Previous value for MouseClickDownDelay is: " + autoItX.AU3_Opt(new WString("MouseClickDownDelay"), 1000)); start = System.currentTimeMillis(); autoItX.AU3_MouseDown(new WString("left")); end = System.currentTimeMillis(); autoItX.AU3_MouseUp(new WString("left")); System.out.println("end - start = " + (end - start)); System.out.println(); // Change MouseClickDownDelay to 2 seconds System.out.println("Previous value for MouseClickDownDelay is: " + autoItX.AU3_Opt(new WString("MouseClickDownDelay"), 2000)); start = System.currentTimeMillis(); autoItX.AU3_MouseDown(new WString("left")); end = System.currentTimeMillis(); autoItX.AU3_MouseUp(new WString("left")); System.out.println("end - start = " + (end - start)); System.out.println(); } protected static interface AutoItX extends Library { public void AU3_MouseDown(WString button); public void AU3_MouseUp(WString button); public int AU3_Opt(WString option, int value); } } The output is: Default value for MouseClickDownDelay is: 10 end - start = 0 Previous value for MouseClickDownDelay is: 10 end - start = 0 Previous value for MouseClickDownDelay is: 1000 end - start = 0 The AU3_MouseDown dose not delayed. You can download MouseDownDemo.zip, it's contains all libs and src to run MouseDownDemo, it can be imported to eclise.MouseDownDemo.zip Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 19, 2014 Share Posted January 19, 2014 I believe that is because AutoIt internally does a Sleep(delay) and sleep of ten milliseconds is unreliable at best. Windows may be optimizing it out. Link to comment Share on other sites More sharing options...
wangzhengbo Posted January 19, 2014 Author Share Posted January 19, 2014 I believe that is because AutoIt internally does a Sleep(delay) and sleep of ten milliseconds is unreliable at best. Windows may be optimizing it out. I think this is a bug in AutoItX. Because i changed the MouseClickDownDelay to 2000 milliseconds, and there is no delay in AU3_MouseDown too. Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 19, 2014 Share Posted January 19, 2014 I think this is a bug in AutoItX. Because i changed the MouseClickDownDelay to 2000 milliseconds, and there is no delay in AU3_MouseDown too. Yes, that would indicate a bug. Post it using the Bug Tracker linked at the top of the forum. Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 27, 2014 Administrators Share Posted July 27, 2014 This only applies to clicks. MouseDown is already holding down the button until a MouseUp so the click delay never comes into play. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 28, 2014 Share Posted July 28, 2014 Oh wow, derp. Good catch Jon. I didn't even bother reading the posted code because I assumed MouseClick was used. Jon 1 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