Skip to content

Commit

Permalink
Fix event type check
Browse files Browse the repository at this point in the history
  • Loading branch information
quaxalber committed Dec 19, 2023
1 parent 88275c2 commit 70987ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bluetooth_2_usb/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ async def async_relay_events_loop(self) -> NoReturn:
await self._async_relay_event(event)

async def _async_relay_event(self, event: InputEvent) -> None:
_logger.debug(f"Received {event} from {self.input_device.name}")
categorized_event = categorize(event)
_logger.debug(f"Received {categorized_event} from {self.input_device.name}")
func = None
if isinstance(event, RelEvent):
if event.type == ecodes.EV_REL:
func = _move_mouse
elif isinstance(event, KeyEvent):
elif event.type == ecodes.EV_KEY:
func = _send_key
if func:
await self._running_loop.run_in_executor(None, func(event))
Expand Down

0 comments on commit 70987ca

Please sign in to comment.