📌  相关文章
📜  python 检查是否按下热键 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:20.204000             🧑  作者: Mango

代码示例1
import keyboard

while True:
    if keyboard.read_key() == "p":
        print("You pressed p")
        break

while True:
    if keyboard.is_pressed("q"):
        print("You pressed q")
        break
        
keyboard.on_press_key("r", lambda _:print("You pressed r"))