diff options
author | Devaev Maxim <[email protected]> | 2018-09-29 07:33:27 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-09-29 07:33:27 +0300 |
commit | 76b95ddfa8d60de4d29e270cbc74cfc8b5144538 (patch) | |
tree | 727412cdbab5d3cc87fc6a5d96ab34b7884d1d9c /kvmd | |
parent | f78d45f4a61a9d26f8ed2bbea44145096d80bea1 (diff) |
improved hid protocol
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/hid.py | 13 |
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: |