BlackEvil Posted November 10, 2009 Share Posted November 10, 2009 Hi How to use an USB mouse with the AutoIt scripts? My script works only if it is a non-usb mouse Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 Strange problem. Can has reproducer? Windows should handle the mouse input correctly, AutoIt does nothing hardware specific (maybe your script does?). github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 10, 2009 Author Share Posted November 10, 2009 Strange problem. Can has reproducer?Windows should handle the mouse input correctly, AutoIt does nothing hardware specific (maybe your script does?).My script does nothing hardware specific as far as I know. My script never worked in a usb mouse but always fine in PS/2. Btw is there any dependency with registry values of USB store? I am in a corporate network where the USB is disabled. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 Does your USB mouse even work at all if USB is disabled? github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 10, 2009 Author Share Posted November 10, 2009 Does your USB mouse even work at all if USB is disabled?Yes of-course. That is why I am so much confused. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 To be honest, I am confused too. There must be something else causing your problem, because I would say the vast majority of AutoIt user base is using a PS/2 mouse, also. Can you maybe write a reproducer script? Say what OS you have, your AutoIt version, etc.. We can try to reproduce the circumstances of your machine, and see if we get the same problem. github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 10, 2009 Author Share Posted November 10, 2009 I am using AutoIT v3.3.0.0. My browser is IE6. I need to move the mouse to the centre of the screen. I am using this code for it. WinSetState("Login - Windows Internet Explorer", "", @SW_MAXIMIZE) WinWaitActive("Login - Windows Internet Explorer", "") MouseClick("primary", @DesktopWidth/2, @DesktopHeight/2 , 4, 0) Send("{TAB}") Send("{ENTER}") ;Login using keyboard controls My OS is XP SP3 Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 I am using AutoIT v3.3.0.0. My browser is IE6. I need to move the mouse to the centre of the screen. I am using this code for it. WinSetState("Login - Windows Internet Explorer", "", @SW_MAXIMIZE) WinWaitActive("Login - Windows Internet Explorer", "") MouseClick("primary", @DesktopWidth/2, @DesktopHeight/2 , 4, 0) Send("{TAB}") Send("{ENTER}") ;Login using keyboard controls My OS is XP SP3 That's been done a few thousand times ... Try this script and see if works.. MouseClick("Left", 0, 0, 1, 10) github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 10, 2009 Author Share Posted November 10, 2009 (edited) That will ruin the script if the user has left handed mouse. Any way I will give a try for it and let you know the results. I am out of office now. Let me do it tomorrow Btw why do you guess that could solve the issue? AutoIt has support for 'primary' as well as 'main' button right? Does this a old syntax? I checked this in my home PC and all of them works as expected. But here the USB drive is enabled. I don'y have the script to disable the USB MouseClick("Primary", @DesktopWidth/2,@DesktopHeight/2,2,100) MsgBox(0, "Primary", "Primary") MouseClick("main", @DesktopWidth/4,@DesktopHeight/4,2,100) MsgBox(0, "Script", "main") MouseClick("Left", @DesktopWidth/3,@DesktopHeight/3,100) MsgBox(0, "Script", "Left") Edited November 10, 2009 by BlackEvil Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 Btw why do you guess that could solve the issue? AutoIt has support for 'primary' as well as 'main' button right? Does this a old syntax?No, I think that the rest of your script logic is wrong and that it never gets to the line that has the MouseClick function on it. That's why I suggest testing the command specifically, outside of the script context, so we can confirm that mouse operations are actually working and focus on the rest of your script. github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 10, 2009 Author Share Posted November 10, 2009 I think that the rest of your script logic is wrongI have the entire script running as expected in PC with PS/2 mouse. Problem is only with machines with USB mouse (to be specific: only in USB drive disabled machines) I tested the code in my home PC (USB Drive enabled)and it works fine. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 10, 2009 Share Posted November 10, 2009 Try it anyway. github.com/jvanegmond Link to comment Share on other sites More sharing options...
BlackEvil Posted November 12, 2009 Author Share Posted November 12, 2009 Instead of "primary" using "main" in MouseClick() will solve the issue. Thank you for the idea! 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