Windows 11 application in Rust that analyzes and aggregates two Lenovo Legion Go 2 controllers (Left + Right) into one virtual XInput controller via ViGEmBus.
- Dual controller support: Automatically detect both Legion Go 2 controllers via Bluetooth HID (VID 0x17EF).
- HID analysis: Extract and parse HID Report Descriptors; classify buttons (0x09), axes (0x01), triggers, hat, digitizer (0x0D), sensors.
- Live input: Decoded input data, raw report hex monitor, axis graphs.
- Virtual controller: Merge Left + Right into one Xbox 360-style controller (ViGEmBus).
- Profiles: JSON mapping profiles; optional per-game auto-switch.
- Debug: Export raw HID logs, report frequency, jitter, dropped frames; learning mode for unknown usages.
- OS: Windows 11 (or Windows 10).
- Rust: Stable toolchain (
rustup default stable). - ViGEmBus: Must be installed for virtual controller support.
- Download the latest ViGEmBus driver from the releases page.
- Run the installer (
ViGEmBus_Setup_x64.msior similar). - Reboot if prompted.
- Verify in Device Manager: under "System devices" you should see "Virtual Gamepad Enumerator Bus".
If the virtual controller does not appear in games, ensure no other process is exclusively using the ViGEm driver.
# Clone and enter project
cd Z13Go
# Debug build
cargo build
# Release build (recommended)
cargo build --releaseBinary: target\release\z13go.exe (or target\debug\z13go.exe).
cargo run --releaseOr run target\release\z13go.exe directly. Start the app, then pair both Legion Go 2 controllers via Bluetooth. The GUI shows controller visualization, HID descriptor tree, hex monitor, and debug stats.
src/
main.rs - Entry point, eframe app
app.rs - Root GUI app state and tabs
hid_layer/ - Device discovery (SetupDi), descriptor (HidP_*), reader (hidapi)
parser/ - HID descriptor parser (hidreport), usage pages, classifier
input_engine/ - Polling threads, ControllerState, calibration
aggregation/ - Left/Right -> XInput mapping, profiles, gyro mouse
virtual_controller/ - ViGEm Xbox 360 target
gui/ - Controller viz, hex monitor, descriptor tree, axis graph, debug, learning
debug/ - HID log export, poll stats
profiles/
default.json - Default button/axis mapping
- Build:
cargo build --releasecompletes without errors. - Run: App starts; window shows "Z13Go" and menu (File, View) and tabs (Controllers, HID Descriptor, Hex Monitor, Debug, Learning).
- ViGEm: Install ViGEmBus; after connecting virtual controller in-app, a new Xbox 360 controller appears in "Set up USB game controllers".
- HID discovery: With at least one Legion Go 2 controller paired via Bluetooth, use "Rescan HID devices" (when wired to discovery) to see devices with VID 0x17EF.
- Left/Right: If both controllers have the same VID/PID, assign Left/Right manually in UI or by first input; confirm left feeds left stick/D-pad/LB/LT and right feeds right stick/ABXY/RB/RT.
- Profiles: Load/save profile from
profiles/; confirm mapping applies (e.g. deadzone, button map). - Debug: Export HID log; check report frequency and that no persistent "dropped frames" or high jitter when controllers are idle.
- Clean shutdown: Close app; virtual controller disappears; no lingering handles or crashes.
- eframe / egui_plot: GUI.
- windows: Win32 HID (SetupDi, HidD_, HidP_) and Security for CreateFile.
- hidapi: HID report reading (windows-native).
- hidreport / hut: HID report descriptor parsing and usage tables.
- vigem-client: ViGEmBus client (Xbox 360 target).
- crossbeam-channel, parking_lot: Concurrency.
- serde / serde_json: Profiles.
MIT.