Skip to content

Examples

01. Basic

  • File: 01_basic.py
  • Summary: Basic example: Read SpaceMouse input with context manager.
  • Run: python examples/01_basic.py
examples/01_basic.py
--8 < --"examples/01_basic.py"

02. Callbacks

  • File: 02_callbacks.py
  • Summary: Callbacks example: React to button presses and axis movements.
  • Run: python examples/02_callbacks.py
examples/02_callbacks.py
--8 < --"examples/02_callbacks.py"

03. Multi Device

  • File: 03_multi_device.py
  • Summary: Multi-device example: Connect to multiple SpaceMouse devices.
  • Run: python examples/03_multi_device.py
examples/03_multi_device.py
--8 < --"examples/03_multi_device.py"

04. Open By Path

  • File: 04_open_by_path.py
  • Summary: Open by path example: Connect to a specific HID device by filesystem path.
  • Run: python examples/04_open_by_path.py
examples/04_open_by_path.py
--8 < --"examples/04_open_by_path.py"

05. Discovery

  • File: 05_discovery.py
  • Summary: Device discovery example: List and inspect available devices.
  • Run: python examples/05_discovery.py
examples/05_discovery.py
--8 < --"examples/05_discovery.py"

06. Axis Callbacks

  • File: 06_axis_callbacks.py
  • Summary: Axis callbacks example: React to specific axis movements.
  • Run: python examples/06_axis_callbacks.py
examples/06_axis_callbacks.py
--8 < --"examples/06_axis_callbacks.py"

07. Led

  • File: 07_led.py
  • Summary: LED control example: Blink the SpaceMouse LED.
  • Run: python examples/07_led.py
examples/07_led.py
--8 < --"examples/07_led.py"

08. Buttons

  • File: 08_buttons.py
  • Summary: Button names example: Show button names when pressed.
  • Run: python examples/08_buttons.py
examples/08_buttons.py
--8 < --"examples/08_buttons.py"

09. Invert Rotations

  • File: 09_invert_rotations.py
  • Summary: Example: Invert rotation axes
  • Run: python examples/09_invert_rotations.py
examples/09_invert_rotations.py
--8 < --"examples/09_invert_rotations.py"

10. Custom Config Unity

  • File: 10_custom_config_unity.py
  • Summary: Example: Custom device configuration with axis remapping.
  • Run: python examples/10_custom_config_unity.py
examples/10_custom_config_unity.py
--8 < --"examples/10_custom_config_unity.py"