xinput-mapper
Functional helpers to convert DirectInput / HID reports → XInput-like states
Pure Rust, no global state, reusable across tools and engines.
✨ Features
- ✅ Parse mapping YAML generated by
dinput_mapper - ✅ Convert raw HID reports into
XInputState - ✅ Pure functional API (no globals, testable)
- ✅ Deadzone, remap, and shaping utilities (
utilsmodule) - ✅ Compatible with ViGEm, custom input bridges, or emulators
📦 Installation
Or add manually to Cargo.toml:
[]
= "0.1"
🧩 Example
use ;
🧠 Public API
| Function | Description |
|---|---|
parse_mapping_yaml_file(path) |
Load YAML mapping file |
map_report_to_xinput(mapping, report) |
Convert HID report → XInput-like state |
XButtons::* |
Standard XInput button bitflags |
utils::* |
Stick shaping, deadzone, button helpers |
For full documentation, see lib.md.
🧾 License
Licensed under either of:
- MIT License — see
LICENSE-MIT - Apache License 2.0 — see
LICENSE-APACHE
Author: [tetthys] Repository: https://github.com/tetthys/xinput-mapper