def _key_up_event(keycode: int) -> HIDEvent: return HIDPress(action=HIDKey(keycode=keycode), direction=HIDDirection.UP)
def key_press_to_events( keycode: int, duration: Optional[float] = None ) -> List[HIDEvent]: return _press_with_duration(HIDKey(keycode=keycode), duration=duration)