hle: event-driven 8 kHz raw mouse ring, cursor capture, KBM+pad XUID binding, and trigger/DualSense haptics #276
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!276
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-276"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Vladimir-Human on GitHub · 2026-11-27 13:22 UTC · original
Vladimir-Human:feat/raw-input-haptics-hid→main· +3083 −221 · 7 files · 1 commits · openSummary
Adds four independently opt-in host input and haptics subsystems inside
crates/victory-hle(zero changes tovictory-gpu,victory-shader, orCargo.lock). All four switches default to0so baseline behavior stays unchanged unless explicitly enabled:VICTORY_RAW_MOUSE=0|10WM_INPUT+ batchedGetRawInputBufferingestion and lock-free microsecond-timestampedMouseRing(RI_MOUSE_*_DOWN/UPedge preservation,MOUSE_HISTORY = 1024). When0, preserves exact baselineVICTORY_GAMEPAD_MOUSE=1single-packetGetRawInputData+GetAsyncKeyStatepath (zero Raw Input registration when both are0).VICTORY_CURSOR_CAPTURE=0|10CursorCapturestate machine (ClipCursor+ exact-step-balancedShowCursorwith owner-thread visibility sync) releasing onWM_KILLFOCUS,WM_ACTIVATE(WA_INACTIVE),WM_ACTIVATEAPP(0),WM_ENTERSIZEMOVE,WM_SIZE(SIZE_MINIMIZED)/SC_MINIMIZE(restoring cleanly viaWM_SIZE(SIZE_RESTORED/SIZE_MAXIMIZED)without requiringSC_RESTORE),end_title,WM_NCDESTROY, and modalxgameuidialogs (OverlayGuard).VICTORY_KBM_PAD=0|10PAD[0..4], stand-in pad,KEYBOARD, andMOUSEdevice IDs simultaneously to the active localXUIDinxuser::find_for_device(returns baselineUSER_NOT_FOUNDwhen0).VICTORY_HAPTICS=0|100xF), preserves trigger levels (params[2..4]), routes non-HID pads to a dedicated MTAWindows.Gaming.Inputworker (Gamepad::SetVibrationwithXInputSetStatefallback), and writes DualSense USB (0x02, 48 B) / Bluetooth (0x31, 78 B + rolling 4-bitseq_tag+0x10tag + IEEE CRC-32 seed0xA2) overlapped HID output reports (0x05Off /0x06Vibration). When0, advertises0x3, zeroes triggers, skips WGI init, and usesXInputSetStateonly.Also populates
KeyState::code_pointanddead_keyviaToUnicodeEx(TOUNICODE_NO_STATE_CHANGE = 0x04, extended scan-code maskscan_code & 0xFF, surrogate pairs,VICTORY_IME_ENGLISH=1US-EnglishHKLawareness).Verification
cargo run -p xtask --locked -- policy:asset policy: 313 files okcargo test -p xtask --locked: 11/11 passedcargo clippy -p victory-hle --all-targets --locked -- -D warnings(default &--all-features): 0 warningscargo test -p victory-hle --lib --locked -- --test-threads=1(default env AND all 4 switches=1, default &--all-features): 218 passed, 0 failed, 3 ignored +no_dll_planting1/1all_four_input_switches_default_off_and_toggle_independently,raw_mouse_and_cursor_capture_switches_are_strictly_independent), 8 kHz delta batching & sub-millisecond click preservation, ring overflow monotonicity,GetRawInputBufferalignment/mixed-type/truncation parsing,CursorCapturefocus/minimize/restore/overlay/pause/ShowCursor balance,ToUnicodeEx/VICTORY_IME_ENGLISHcode points & dead keys,xuser::find_for_devicedefault-off & opted-in KBM+pad binding, WGI mapping & fallback, and byte-exact DualSense USB0x02/ BT0x31+0xA2CRC-32 vectors.@TaynanGT on GitHub · 2026-11-27 13:37 UTC · original
@Vladimir-Human The mouse ring, cursor ownership, user binding and haptics should be testable separately. #256 already has a resize and trigger check, with camera movement still under investigation. I’ll compare the incoming WM_INPUT path against that case before combining the window changes.
745f2a0bc6to9e8b7f9ba2@Vladimir-Human on GitHub · 2026-11-27 14:14 UTC · original
@TaynanGT Updated
#276(9e8b7f9) so all four subsystems are gated behind independent opt-in switches that default to0, keeping baseline behavior (includingVICTORY_GAMEPAD_MOUSE=1single-packetGetRawInputData+GetAsyncKeyStateand#256'sWM_INPUT/resize comparison) untouched unless explicitly enabled:VICTORY_RAW_MOUSE=1— event-driven 8 kHzWM_INPUT+ batchedGetRawInputBufferring (gameinput/mouse.rs,gameinput.rs; auto-disables batch draining if any non-mouse Raw Input device/packet appears).VICTORY_CURSOR_CAPTURE=1— independentClipCursor+ balancedShowCursorfocus/minimize/overlay/pause ownership (gameinput/mouse.rs,lifecycle.rs,xgameui.rs), testable with or withoutVICTORY_RAW_MOUSE=1.VICTORY_KBM_PAD=1— simultaneousPAD[0..4]+ stand-in pad +KEYBOARD+MOUSElocalXUIDbinding inxuser::find_for_device(xuser.rs, returns baselineUSER_NOT_FOUNDwhen0).VICTORY_HAPTICS=1— 4-motor trigger haptics (0xF) via dedicated MTAWindows.Gaming.Inputworker (XInputSetStatefallback) and DualSense USB0x02/ Bluetooth0x31(0xA2CRC-32) overlapped HID output reports (gameinput.rs,gameinput/dualsense.rs; stays on baseline0x3+XInputSetState-only with zero WGI/HID output when0).Verified default-off parity and independent switching under both default env and all-4-switches-on (
218/218victory-hlelib tests,0clippy warnings default &--all-features,xtask11/11).@TaynanGT on GitHub · 2026-11-27 14:25 UTC · original
@Vladimir-Human The four independent switches give us a way to isolate each change. #220 still needs to show whether the title reads the nonzero stick state from #256, so keep that camera test on the smaller branch. #292 touches the same HID reader. Please keep USB DS4 input covered when updating the haptics branch.
9e8b7f9ba2to462476f6d1@Vladimir-Human on GitHub · 2026-11-27 15:01 UTC · original
Rebased
#276cleanly ontomain(b67e8d8, commit462476f) after#292, preserving all USB DualShock 4 input support/tests and gating DualSense0x02/0x31output report formatting so USB DualShock 4 pads never receive DualSense packets (format_output_report).All four independent opt-in switches (
VICTORY_RAW_MOUSE,VICTORY_CURSOR_CAPTURE,VICTORY_KBM_PAD,VICTORY_HAPTICS) remain0by default; re-verifiedvictory-hle228/228(both all-0and all-1),0clippy warnings, andxtask11/11.@TaynanGT on GitHub · 2026-11-27 15:08 UTC · original
@Vladimir-Human The device-specific output guard covers the DS4 issue from #292. The useful hardware pair now is a USB DS4 and a DualSense on the same build, with haptics enabled. That checks DS4 input alongside the DualSense output path. The camera read trace can stay with #220.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.