summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/bt/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/plugins/hid/bt/__init__.py')
-rw-r--r--kvmd/plugins/hid/bt/__init__.py48
1 files changed, 22 insertions, 26 deletions
diff --git a/kvmd/plugins/hid/bt/__init__.py b/kvmd/plugins/hid/bt/__init__.py
index bca8f9a5..4d0effb5 100644
--- a/kvmd/plugins/hid/bt/__init__.py
+++ b/kvmd/plugins/hid/bt/__init__.py
@@ -24,7 +24,6 @@ import multiprocessing
import copy
import time
-from typing import Iterable
from typing import AsyncGenerator
from typing import Any
@@ -64,6 +63,11 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
def __init__( # pylint: disable=too-many-arguments,too-many-locals
self,
+ ignore_keys: list[str],
+ mouse_x_range: dict[str, Any],
+ mouse_y_range: dict[str, Any],
+ jiggler: dict[str, Any],
+
manufacturer: str,
product: str,
description: str,
@@ -79,11 +83,9 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
max_clients: int,
socket_timeout: float,
select_timeout: float,
-
- jiggler: dict[str, Any],
) -> None:
- super().__init__(**jiggler)
+ super().__init__(ignore_keys=ignore_keys, **mouse_x_range, **mouse_y_range, **jiggler)
self._set_jiggler_absolute(False)
self.__proc: (multiprocessing.Process | None) = None
@@ -127,7 +129,7 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
"socket_timeout": Option(5.0, type=valid_float_f01),
"select_timeout": Option(1.0, type=valid_float_f01),
- **cls._get_jiggler_options(),
+ **cls._get_base_options(),
}
def sysprep(self) -> None:
@@ -187,27 +189,6 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
# =====
- def send_key_events(self, keys: Iterable[tuple[str, bool]]) -> None:
- for (key, state) in keys:
- self.__server.queue_event(make_keyboard_event(key, state))
- self._bump_activity()
-
- def send_mouse_button_event(self, button: str, state: bool) -> None:
- self.__server.queue_event(MouseButtonEvent(button, state))
- self._bump_activity()
-
- def send_mouse_relative_event(self, delta_x: int, delta_y: int) -> None:
- self.__server.queue_event(MouseRelativeEvent(delta_x, delta_y))
- self._bump_activity()
-
- def send_mouse_wheel_event(self, delta_x: int, delta_y: int) -> None:
- self.__server.queue_event(MouseWheelEvent(delta_x, delta_y))
- self._bump_activity()
-
- def clear_events(self) -> None:
- self.__server.clear_events()
- self._bump_activity()
-
def set_params(
self,
keyboard_output: (str | None)=None,
@@ -221,6 +202,21 @@ class Plugin(BaseHid): # pylint: disable=too-many-instance-attributes
self._set_jiggler_active(jiggler)
self.__notifier.notify()
+ def _send_key_event(self, key: str, state: bool) -> None:
+ self.__server.queue_event(make_keyboard_event(key, state))
+
+ def _send_mouse_button_event(self, button: str, state: bool) -> None:
+ self.__server.queue_event(MouseButtonEvent(button, state))
+
+ def _send_mouse_relative_event(self, delta_x: int, delta_y: int) -> None:
+ self.__server.queue_event(MouseRelativeEvent(delta_x, delta_y))
+
+ def _send_mouse_wheel_event(self, delta_x: int, delta_y: int) -> None:
+ self.__server.queue_event(MouseWheelEvent(delta_x, delta_y))
+
+ def _clear_events(self) -> None:
+ self.__server.clear_events()
+
# =====
def __server_worker(self) -> None: # pylint: disable=too-many-branches