Crates.io | hut |
lib.rs | hut |
version | 0.3.0 |
source | src |
created_at | 2024-05-15 09:10:57.584759 |
updated_at | 2024-11-19 00:52:17.891187 |
description | The HID Usage Tables |
homepage | https://github.com/hidutils |
repository | https://github.com/hidutils/hut |
max_upload_size | |
id | 1240805 |
size | 1,342,665 |
This crate provides access to the HID Usage Tables (HUT).
This module is created through code generation from the HID Usage Tables.
This crate merely provides enums and functions to convert between values, it
does not concern itself with how to obtain the values to be used. Look at e.g.
the hidreport
crate for parsing HID Report descriptors.
use hut::*;
let usage = Usage::from(GenericDesktop::Mouse);
let usage_page_value: u16 = 0x01; // Generic Desktop
let usage_id_value: u16 = 0x02; // Mouse
let usage_value: u32 = (usage_page_value as u32) << 16 | usage_id_value as u32;
let u: Usage = Usage::try_from(usage_value).unwrap();
See the documentation for more details.
hut
is MIT-licensed, see the COPYING file for details.