I am trying to simulate a mouse click in specific spot while still being able to control the mouse. From my understanding, I can use the library pyautoit with the command control_click to do this.
For example, I want to click at the location (1097, 832), but want to still be using the mouse when this action is occurring.
The only example I have seen using this command in python is in the code below.
import autoit
autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")
This is the function from the library
def control_click(title, control, **kwargs):
"""
:param title:
:param text:
:param control:
:param button:
:param clicks:
:param x:
:param y:
:return:
"""
text = kwargs.get("text", "")
button = kwargs.get("button", "left")
clicks = kwargs.get("clicks", 1)
x = kwargs.get("x", INTDEFAULT)
y = kwargs.get("y", INTDEFAULT)
ret = AUTO_IT.AU3_ControlClick(LPCWSTR(title), LPCWSTR(text),
LPCWSTR(control), LPCWSTR(button),
INT(clicks), INT(x), INT(y))
return ret