summaryrefslogtreecommitdiff
path: root/kvmd/hid.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/hid.py')
-rw-r--r--kvmd/hid.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/kvmd/hid.py b/kvmd/hid.py
index b1d69ad6..e5d4de78 100644
--- a/kvmd/hid.py
+++ b/kvmd/hid.py
@@ -153,13 +153,14 @@ class Hid(multiprocessing.Process):
else:
raise RuntimeError("Unknown HID event")
hid_ready = False
+
+ if tty.in_waiting:
+ while tty.in_waiting:
+ tty.read(tty.in_waiting)
+ hid_ready = True
else:
- if tty.in_waiting:
- while tty.in_waiting:
- tty.read(tty.in_waiting)
- hid_ready = True
- else:
- time.sleep(0.05)
+ time.sleep(0.05)
+
if self.__stop_event.is_set() and self.__queue.qsize() == 0:
break
except Exception: