Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nobonobo/hid

HID wrapper library for Wasm and Native Cross support.
https://github.com/nobonobo/hid

Last synced: 22 days ago
JSON representation

HID wrapper library for Wasm and Native Cross support.

Awesome Lists containing this project

README

        

# hid

Cross PLatform HID API

- Native(Linux, Windows, MacOS)
- Wasm(js)

## Global Types

- HIDDeviceFilter struct
- VendorId
- ProductId

## Global functions

- GetDevices() ([]\*HIDDevice, error)
- RequestDevice(options ...HIDDeviceFilter) ([]\*HIDDevice, error)

## type HIDDevice struct

Getters:

- Opened() bool
- VendorID() uint16
- ProductID() uint16
- Path() string
- ProductName() string

Methods:

- OnInputReport(callback func([]byte)
- Open() error
- Close() error
- SendReport(id byte, data []byte) error
- SendFeatureReport(id byte, data []byte) error
- ReceiveFeatureReport(id byte) ([]byte, error)