Skip to content

hid_devices

Joystick

Connect a Joystick to control parameters. This class supports Logitech Extreme 3D Pro and Thrustmaster joysticks, whose HID reports were parse manually. See the parse_report method for the report format for these joysticks. Yours will probably be something like that!

__init__(name, vendor_id=1133, product_id=49685)

Initialize connection with a Joystick.

Parameters:

Name Type Description Default
name str

Joystick name. Will be used to look up the correct parser function found in hid_parse_defs.py.

required
vendor_id

Identification number of the vendor.

1133
product_id

Identification number of the product.

49685

connect()

Connect to the joystick

disconnect()

Disconnect from the joystick

parse_report(data)

Parse the 8-byte HID report from Logitech Extreme 3D Pro or Thrustmaster joystick

read_continuous(name, function, duration=None)

Read joystick data continuously.

Parameters:

Name Type Description Default
name str

Joystick name

required
function Callable[..., None]

Function to call with joystick data

required
duration Optional[float]

Duration to read data (in seconds). If None, read indefinitely.

None