我使用 python-evdev 库来检测键盘事件。
但是我有一个问题,我需要在检测到键后刷新键盘事件。
例子:
from evdev import InputDevice, categorize, ecodes
dev = InputDevice('/dev/input/event1')
for event in dev.read_loop():
if event.type == ecodes.EV_KEY:
print(categorize(event))
#to do..............
>>>flush here> KEYBOARD EVENT>>
如何刷新开发?