diff --git a/src/filtering.py b/src/filtering.py index 8fc185d..7e59770 100644 --- a/src/filtering.py +++ b/src/filtering.py @@ -3,9 +3,11 @@ from typing import DefaultDict, Dict, NoReturn import libevdev - +import time def filter_chattering(evdev: libevdev.Device, threshold: int) -> NoReturn: + # add delay to allow enter key to work after execution + time.sleep(1) # grab the device - now only we see the events it emits evdev.grab() # create a copy of the device that we can write to - this will emit the filtered events to anyone who listens @@ -55,4 +57,4 @@ def _from_keystroke(event: libevdev.InputEvent, threshold: int) -> bool: _last_key_up: Dict[libevdev.EventCode, int] = {} -_key_pressed: DefaultDict[libevdev.EventCode, bool] = defaultdict(bool) \ No newline at end of file +_key_pressed: DefaultDict[libevdev.EventCode, bool] = defaultdict(bool)