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