pip install keyboard
import keyboard
def hello():
print("hello world")
# 右键触发hello函数
keyboard.add_hotkey('right', hello)
# 阻塞,直至等待到ctrl+c信号
keyboard.wait('ctrl + c')
pip install keyboard
import keyboard
def hello():
print("hello world")
# 右键触发hello函数
keyboard.add_hotkey('right', hello)
# 阻塞,直至等待到ctrl+c信号
keyboard.wait('ctrl + c')
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。