from playsound import playsound from pynput import mouse def on_click(x, y, button, pressed): if pressed: print("clicked") play