input(macos): wire GameController extendedGamepad into GameInput #11
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!11
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/11/head"
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?
@claytonblythe on GitHub · 2026-11-26 08:55 UTC · original
claytonblythe:feat/macos-game-controller→main· +315 −5 · 2 files · 1 commits · merged 2026-11-26 09:21 UTCWhat this changes
Closes #10. Wires Apple's
GameController.framework(GCController/GCExtendedGamepad) intoGameInputon macOS so Xbox, DualSense, and MFi controllers drive the game's gamepad alongside the keyboard andVICTORY_KEYS.crates/victory-hle/src/modules/gameinput.rs:ControllerSnapshot,pad_from_snapshot,set_live_pad, andrelease_live_padunder#[cfg(not(windows))](maps A/B/X/Y, D-pad, shoulders, L3/R3 stick clicks, Menu/View, analog triggers0..=1, and analog sticks-1..=1, sanitizing non-finite values and clamping ranges).stand_in_pad+merge_pad(buttons ORed, triggers max, sticks summed and clamped), so physical controllers work seamlessly alongside live keyboard keys andVICTORY_KEYS.apps/victory/src/window.rs:GameController.frameworkand polls the first connectedGCControllerwith anextendedGamepadeach iteration ofevent_loopwhileisKeyWindowis true.buttonOptions,leftThumbstickButton,rightThumbstickButton) safely.release_live_pad()on disconnect, window focus loss, and window exit so no button or axis sticks.How it was tested
cargo test --target x86_64-apple-darwin -p victory window(2/2 passed, includingpoll_controller_queries_game_controller_framework_cleanlyagainst liveGameController.framework)cargo test --target x86_64-apple-darwin -p victory-hle gameinput(11/11 passed, includingcontroller_snapshot_maps_all_buttons_and_analog_axesandlive_controller_merges_with_keyboard_and_clears_on_release)cargo xtask policy(356 files ok)cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings(0 warnings)GameController.frameworklinking/querying on Apple M4 macOS 26.3 and end-to-end snapshot ->HubCOM reading path in unit tests)Checklist
VICTORY_*variable and documented (N/A)@LakshanSivakumar on GitHub · 2026-11-26 09:21 UTC · original · approved these changes
Reviewed and tested merged with main on macOS (tests, Windows clippy, policy). Thanks!