JGuizard
8/9/2017 - 3:53 PM

A simple function to controll the mouse

A simple function to controll the mouse

import win32api, win32con
 
def click(x,y): #FUNZIONE CLICK PER SPOSTARE IL CURSORE SULLO SCHERMO, nella posizione 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(100,100) #Richiamiamo la funzione