I would like to receive an event on mouse click / release, with its position on the screen, in a python program on a mac. How can I achieve that ?
Ideally I would like to be able to prevent default action on this click (such as e.preventDefault() in web development).
CodePudding user response:
pynput does the job.
from pynput.mouse import Listener
with Listener(on_click=print) as listener:
listener.join()
