Mouse connector

This module provides the whad.unifying.connector.mouse.Mouse class that behaves like a Logitech Unifying mouse. This class is able to synchronize with a specific dongle and send valid mouse and wheel moves as well as clicks.

This connector must be used with a compatible Logitech Unifying device.

class whad.unifying.connector.mouse.Mouse(device: WhadDevice)[source]

Logitech Unifying Mouse interface for compatible WHAD device.

property address: ESBStack

Retrieve the underlying stack

Returns:

Underlying ESB stack instance

Return type:

whad.esb.stack.ESBStack

property channel: int

Retrieve current channel.

Returns:

current channel number

Return type:

int

left_click()[source]

Send a left click to the target mouse dongle.

lock()[source]

Lock mouse onto current channel.

middle_click()[source]

Send a middle click to the target mouse dongle.

move(x: int, y: int)[source]

Send a move event to the target mouse dongle.

Parameters:
  • x (int) – Delta X in ticks

  • y (int) – Delta Y in ticks

on_pdu(packet)[source]

ESB packet handler. Feed the underlying ESB stack.

right_click()[source]

Send a right click to the target mouse dongle.

start()[source]

Start mouse emulation

stop()[source]

Stop mouse emulation

synchronize(timeout: float = 10.0) bool[source]

Synchronize with target mouse.

Parameters:

timeout (float) – timeout in seconds

Returns:

True if synchronization succeeded, False otherwise

Return type:

bool

unlock()[source]

Unlock mouse from current channel.

wheel_down()[source]

Send a wheel down event to target mouse dongle.

wheel_left()[source]

Send a wheel left event to target mouse dongle.

wheel_right()[source]

Send a wheel right event to target mouse dongle.

wheel_up()[source]

Send a wheel up event to target mouse dongle.