Files
xone_macos/include/hid/hid_device.hpp
T
portersky fafca4c265 feat: add Xbox One HID report layout and mapping
Phase 4 foundation, independent of the presentation mechanism:

- hid/hid_report.hpp: standard Xbox One report layout (64-byte input:
  buttons/guide/triggers/sticks; 64-byte output: motors), the HID
  report descriptor, and GIP state to report mapping.
- make_input_report(): remaps GIP button bits to the standard Xbox
  bitmask, scales 10-bit triggers to 8-bit, sticks pass through.
- parse_output_report(): extracts motor intensities from output
  reports for the rumble relay; malformed reports stop the motors.
- test_hid: unit tests for the mapping, scaling, and descriptor.

Report packing verified with a descriptor walker: input and output
are exactly 64 bytes each. Next step is presentation via DriverKit,
which needs a Developer ID with the DriverKit entitlement.

Co-Authored-By: qwen3.8-27b@q3_k_xl: implemented HID report layer
2026-08-29 15:39:03 +02:00

21 lines
865 B
C++

#pragma once
// ==============================================================================
// Virtual HID gamepad presentation
// ==============================================================================
// Exposes connected controllers to macOS so games recognize them natively.
// Preferred path: DriverKit extension implementing IOHIDDriver with an
// Xbox 360/One-compatible report descriptor (input reports from GIP, output
// reports for rumble relayed back via GIP).
//
// The standard Xbox One report layout and its HID report descriptor live in
// hid/hid_report.hpp; this module still needs the virtual device that
// presents them to macOS.
// ==============================================================================
namespace xone::hid {
// TODO(phase 4): virtual device presentation (DriverKit IOHIDDriver).
} // namespace xone::hid