Mouse-click without moving cursor?

11,074

Thank you to those who have tried to help me out. After further research I have found a solution. I have found a way to import AutoIt into Python by using PyAutoIt. There is a ControlClick function that I have been looking for that clicks a control without moving the mouse cursor. Here is an example:

import autoit
import time

autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
time.sleep(5)
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")

Thanks again. This thread can be marked answered and closed :)

Share:
11,074
Double-A
Author by

Double-A

Updated on June 05, 2022

Comments

  • Double-A
    Double-A about 2 years

    I can't seem to find a specific answer to this question. How do I click coordinates on the screen without moving the cursor? I am working on a project that will automate installations of programs, but would still like control of the mouse to do other tasks while installations are being processed. Any ideas? Some examples would be awesome as well.