From 5a78819e5890d7e396cd4b7a9c062fc2a7ffe969 Mon Sep 17 00:00:00 2001 From: some1ataplace <99353321+some1ataplace@users.noreply.github.com> Date: Sat, 7 Mar 2026 05:45:52 +0000 Subject: [PATCH] Update filtering.py with delay --- src/filtering.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)