1

How do I detect a mouse click on screen on a mac?

I have seen many people use win32api however this is only supported for windows, and not for mac also.

Opir
  • 21
  • 2

2 Answers2

1

Similar question with answers:

By using the ctypes module:

Thymen
  • 1,759
  • 1
  • 8
  • 11
0

If you wanna click on the screen with python i recommend you use pyautogui. https://pyautogui.readthedocs.io/en/latest/ If you want to download it onto terminal just type pip install pyautogui!

Here are some clicks you can use:

import pyautogui

pyautogui.click()          # Click the mouse.

pyautogui.click(100, 200)  # Move the mouse to XY coordinates and click it.

pyautogui.click('button.png') # Find where button.png appears on the screen and click it.
Park
  • 1,924
  • 1
  • 15
  • 19