代码之家  ›  专栏  ›  技术社区  ›  Muhammad Ikhwan Perwira

Python检测耳机按钮按下

  •  0
  • Muhammad Ikhwan Perwira  · 技术社区  · 4 年前

    我只需要简单的库,检测耳机按钮的状态。

    所以我希望有这样简单的程序。

    from hsbutton import isPressed
    
    while True:
      if isPressed():
        Print("You are clicking headset button")
      else:
        Print("Waiting click")
        
    

    编辑: Tbh我不知道耳机和耳机的区别,所以我给你看图片。 在那张照片中你可以看到我在一个按钮上画了圈。那个按钮就是我的意思。 enter image description here

    0 回复  |  直到 4 年前
    推荐文章