How can I programmatically control mouse motion and clicks with MATLAB?
Ältere Kommentare anzeigen
I am creating a demo using MATLAB and I would like to programmatically move and click the mouse to demonstrate my application.
Akzeptierte Antwort
Weitere Antworten (1)
Unfortunately, this is one area that MATLAB is behind other alternatives, such as Python. If you know how to code in Python, you can easily do it by using the following command:
import win32api, win32con
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
click(10,10)
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!