diff options
author | Devaev Maxim <[email protected]> | 2020-05-23 11:57:19 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-05-23 11:57:19 +0300 |
commit | a795fe5ed63b960cbf24c9130ed37f9f7f33280c (patch) | |
tree | 51b884539614ed380cb19cd60e4dae7c8baab090 /kvmd/plugins/hid/serial.py | |
parent | 17082c916a1d80d92bb5a51fed67f030f605f804 (diff) |
additional keymapping info; refactoring
Diffstat (limited to 'kvmd/plugins/hid/serial.py')
-rw-r--r-- | kvmd/plugins/hid/serial.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/plugins/hid/serial.py b/kvmd/plugins/hid/serial.py index f2ece19d..c41c762c 100644 --- a/kvmd/plugins/hid/serial.py +++ b/kvmd/plugins/hid/serial.py @@ -39,10 +39,11 @@ import setproctitle from ...logging import get_logger +from ...keyboard.mappings import KEYMAP + from ... import aiotools from ... import aiomulti from ... import gpio -from ... import keymap from ...yamlconf import Option @@ -75,10 +76,10 @@ class _KeyEvent(_BaseEvent): state: bool def __post_init__(self) -> None: - assert self.name in keymap.KEYMAP + assert self.name in KEYMAP def make_command(self) -> bytes: - code = keymap.KEYMAP[self.name].serial.code + code = KEYMAP[self.name].serial.code return struct.pack(">BBBxx", 0x11, code, int(self.state)) |