moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.79k stars 248 forks source link

Detect earphone/headset button #454

Open ikhwanperwira opened 2 years ago

ikhwanperwira commented 2 years ago

I wish there's simple program like this

from pynput.headset import isPressed

While True:
  if isPressed():
    print("clicking")
  else:
    print("no press")