how to use pynput mouse in python

Solutions on MaxInterview for how to use pynput mouse in python by the best coders in the world

showing results for - "how to use pynput mouse in python"
Emanuele
29 Oct 2016
1from pynput.mouse import Button, Controller
2mouse = Controller()
3
4# move the pointer
5mouse.position = (10, 20)
6
7# Press and release
8mouse.press(Button.left)
9mouse.release(Button.left)
10
11# Double click; this is different from pressing and releasing
12mouse.click(Button.left, 2)
13
14# Scroll two steps down
15mouse.scroll(0, 2)
16