crystal-hidapi
Version, currently main branch1 version
- main branchlatestJun 23, 2026
github.com/mamantoha/crystal-hidapi
A Crystal interface to HIDAPI library.
2 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
crystal-hidapi:
github: mamantoha/crystal-hidapi
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.7.3- License
- MIT
- Author
- Anton Maminov
Dependencies
Development Dependencies
- crystal_lib*github: crystal-lang/crystal_libdev
README
crystal-hidapi
A Crystal interface to HIDAPI library.
It works on Linux and macOS.
Installation
-
Add the dependency to your
shard.yml:dependencies: crystal-hidapi: github: mamantoha/crystal-hidapi -
Run
shards install
Compile time dependencies
You need to install the development package for hidapi
- macOS:
brew install hidapi - Arch Linux:
pacman -S hidapi - Ubuntu:
apt install libhidapi-dev
Usage
require "crystal-hidapi"
Sample Usage
Explore the following examples:
- Retrieve battery level for Sony PlayStation 5 DualSense controller
- Fetch battery capacity and status for Sony DualShock4 (2nd gen) controller
Development
crystal ./lib/crystal_lib/src/main.cr src/hidapi/lib_hidapi.cr.in > src/hidapi/lib_hidapi.cr
External Resources Usage
Contributing
- Fork it (https://github.com/mamantoha/crystal-hidapi/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Anton Maminov - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Jun 23, 2026
- Crystal
1.7.3- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/mamantoha/crystal-hidapi
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1