summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/otg/device.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-05-22 21:07:54 +0300
committerDevaev Maxim <[email protected]>2020-05-22 21:07:54 +0300
commit43afd9acb3a7f2c94a3515f580ec3afcee720dc2 (patch)
treee1e3031ea1f083f17751c4997f29708dfb7e5d98 /kvmd/plugins/hid/otg/device.py
parent0fa0680bd7c28e246c70b5a5102e38a592bd0f0d (diff)
server-side paste-as-keys
Diffstat (limited to 'kvmd/plugins/hid/otg/device.py')
-rw-r--r--kvmd/plugins/hid/otg/device.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py
index 2986ce4e..d1a2c86c 100644
--- a/kvmd/plugins/hid/otg/device.py
+++ b/kvmd/plugins/hid/otg/device.py
@@ -126,6 +126,10 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
def _queue_event(self, event: BaseEvent) -> None:
self.__events_queue.put_nowait(event)
+ def _clear_queue(self) -> None:
+ while not self.__events_queue.empty():
+ self.__events_queue.get_nowait()
+
def _ensure_write(self, report: bytes, reopen: bool=False, close: bool=False) -> bool:
if reopen:
self.__close_device()