Socket
Book a DemoInstallSign in
Socket

mygithub.libinneed.workers.dev/sstallion/go-hid

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mygithub.libinneed.workers.dev/sstallion/go-hid

Go Modules
Version
v0.15.0
Version published
Created
Source

HIDAPI Bindings for Go

Package hid provides an idiomatic interface to HIDAPI, a simple library for communicating with USB and Bluetooth HID devices on FreeBSD, Linux, macOS, and Windows.

See https://github.com/libusb/hidapi for details.

Installation

To add package hid as a dependency or upgrade to its latest version, issue:

$ go get github.com/sstallion/go-hid@latest

[!NOTE] Prerequisites for building HIDAPI from source must be installed prior to issuing go get. See Prerequisites for details.

[!IMPORTANT] This package requires cgo. GCC must be installed and available on the system PATH before compilation. See the cgo documentation for details.

libusb Backend Support

On Linux, the hidraw backend is enabled by default. If the libusb backend is desired, the libusb build constraint must be specified:

$ go build -tags libusb ./...

lshid

A command named lshid is provided, which lists HID devices attached to the system. lshid may be installed by issuing:

$ go install github.com/sstallion/go-hid/cmd/lshid@latest

Once installed, issue lshid -h to show usage.

Documentation

Up-to-date documentation can be found on pkg.go.dev or by issuing the go doc command after installation:

$ go doc -all github.com/sstallion/go-hid

Contributing

Pull requests are welcome! See CONTRIBUTING.md for details.

License

Source code in this repository is licensed under a Simplified BSD License. See LICENSE for details.

FAQs

Package last updated on 23 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts