Skip to main content
Version: Matrix OS 3.2

RawHID API

Preview notice

The MatrixOS Python API is in preview and is subject to change; it may contain errors.

Overview

The HID RawHID interface provides custom communication protocols for applications that need specialized HID functionality beyond standard keyboard, mouse, and gamepad interfaces. This allows for bidirectional communication and application-specific messaging.

The Python HID RawHID API is implemented in Applications/Python/PikaPython/MatrixOS_HID_RawHID.py with type hints in Applications/Python/PikaPython/_MatrixOS_HID_RawHID.pyi.


MatrixOS.HID.RawHID.Get

def Get(timeout_ms: int = 0) -> bytes

Receives raw HID data from the host.

Parameters:

  • timeout_ms (int, optional): Timeout in milliseconds to wait for data (defaults to 0 for no timeout)

Returns:

  • bytes: Received raw HID data, or empty bytes if no data available

MatrixOS.HID.RawHID.Send

def Send(report: bytes) -> bool

Sends raw HID data to the host.

Parameters:

  • report (bytes): Raw HID report data to send

Returns:

  • bool: True if sent successfully, False on error

Comments