summaryrefslogtreecommitdiff
path: root/kvmd/plugins
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-07-22 04:36:54 +0300
committerMaxim Devaev <[email protected]>2022-07-22 04:36:54 +0300
commit867412a6cdc91f997baa42cee92df2b466dfdc75 (patch)
treedbb0da45518763f2b211cee3f90f963b9957a254 /kvmd/plugins
parent249098b41c2372052ff90d017f18f30772d1f839 (diff)
renamed otg key to usb key
Diffstat (limited to 'kvmd/plugins')
-rw-r--r--kvmd/plugins/hid/bt/server.py6
-rw-r--r--kvmd/plugins/hid/otg/events.py18
-rw-r--r--kvmd/plugins/hid/otg/keyboard.py6
3 files changed, 15 insertions, 15 deletions
diff --git a/kvmd/plugins/hid/bt/server.py b/kvmd/plugins/hid/bt/server.py
index feac5329..9cfbce53 100644
--- a/kvmd/plugins/hid/bt/server.py
+++ b/kvmd/plugins/hid/bt/server.py
@@ -40,7 +40,7 @@ from ....logging import get_logger
from .... import tools
from .... import aiomulti
-from ....keyboard.mappings import OtgKey
+from ....keyboard.mappings import UsbKey
from ..otg.events import BaseEvent
from ..otg.events import ClearEvent
@@ -115,8 +115,8 @@ class BtServer: # pylint: disable=too-many-instance-attributes
"scroll": False,
"num": False,
}, notifier)
- self.__modifiers: Set[OtgKey] = set()
- self.__keys: List[Optional[OtgKey]] = [None] * 6
+ self.__modifiers: Set[UsbKey] = set()
+ self.__keys: List[Optional[UsbKey]] = [None] * 6
self.__mouse_buttons = 0
def run(self) -> None:
diff --git a/kvmd/plugins/hid/otg/events.py b/kvmd/plugins/hid/otg/events.py
index 954a7131..e1f0f35c 100644
--- a/kvmd/plugins/hid/otg/events.py
+++ b/kvmd/plugins/hid/otg/events.py
@@ -28,7 +28,7 @@ from typing import Set
from typing import Optional
from typing import Union
-from ....keyboard.mappings import OtgKey
+from ....keyboard.mappings import UsbKey
from ....keyboard.mappings import KEYMAP
from ....mouse import MouseRange
@@ -50,7 +50,7 @@ class ResetEvent(BaseEvent):
# =====
@dataclasses.dataclass(frozen=True)
class KeyEvent(BaseEvent):
- key: OtgKey
+ key: UsbKey
state: bool
def __post_init__(self) -> None:
@@ -59,7 +59,7 @@ class KeyEvent(BaseEvent):
@dataclasses.dataclass(frozen=True)
class ModifierEvent(BaseEvent):
- modifier: OtgKey
+ modifier: UsbKey
state: bool
def __post_init__(self) -> None:
@@ -67,10 +67,10 @@ class ModifierEvent(BaseEvent):
def make_keyboard_event(key: str, state: bool) -> Union[KeyEvent, ModifierEvent]:
- otg_key = KEYMAP[key].otg
- if otg_key.is_modifier:
- return ModifierEvent(otg_key, state)
- return KeyEvent(otg_key, state)
+ usb_key = KEYMAP[key].usb
+ if usb_key.is_modifier:
+ return ModifierEvent(usb_key, state)
+ return KeyEvent(usb_key, state)
def get_led_caps(flags: int) -> bool:
@@ -87,8 +87,8 @@ def get_led_num(flags: int) -> bool:
def make_keyboard_report(
- pressed_modifiers: Set[OtgKey],
- pressed_keys: List[Optional[OtgKey]],
+ pressed_modifiers: Set[UsbKey],
+ pressed_keys: List[Optional[UsbKey]],
) -> bytes:
modifiers = 0
diff --git a/kvmd/plugins/hid/otg/keyboard.py b/kvmd/plugins/hid/otg/keyboard.py
index 3392e8f9..2403dc2c 100644
--- a/kvmd/plugins/hid/otg/keyboard.py
+++ b/kvmd/plugins/hid/otg/keyboard.py
@@ -30,7 +30,7 @@ from typing import Any
from ....logging import get_logger
-from ....keyboard.mappings import OtgKey
+from ....keyboard.mappings import UsbKey
from .device import BaseDeviceProcess
@@ -56,8 +56,8 @@ class KeyboardProcess(BaseDeviceProcess):
**kwargs,
)
- self.__pressed_modifiers: Set[OtgKey] = set()
- self.__pressed_keys: List[Optional[OtgKey]] = [None] * 6
+ self.__pressed_modifiers: Set[UsbKey] = set()
+ self.__pressed_keys: List[Optional[UsbKey]] = [None] * 6
def cleanup(self) -> None:
self._stop()