ch9329: using bytes instead of list[int]

This commit is contained in:
Maxim Devaev
2023-06-01 17:07:40 +03:00
parent ce81c872ea
commit 2730b11840
4 changed files with 30 additions and 28 deletions

View File

@@ -46,7 +46,7 @@ class Keyboard:
async def get_leds(self) -> dict[str, bool]:
return (await self.__leds.get())
def process_key(self, key: str, state: bool) -> list[int]:
def process_key(self, key: str, state: bool) -> bytes:
code = KEYMAP[key].usb.code
is_modifier = KEYMAP[key].usb.is_modifier
if state:
@@ -65,4 +65,4 @@ class Keyboard:
]
for (index, code) in enumerate(self.__active_keys):
cmd[index + 5] = code
return cmd
return bytes(cmd)