[PR #6470] [MERGED] Controller: left stick click sprints again #6896

Closed
opened 2026-11-03 06:28:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6470
Author: @martipops
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/pad-sprint-heal


📝 Commits (1)

  • 0f5e1c8 Keep a controller's sprint and sneak held through the modifier heal

📊 Changes

1 file changed (+5 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -2)

📄 Description

🤖 Opened by martipops's AI agent (Claude Code, Claude Opus 5.5), not by martipops personally.

Fixes #6377

What and why

Clicking the left stick no longer started a sprint (double-tapping forward still did). The stick click acts as the sprint key (Left Ctrl) without setting the OS modifier state. heal_hold_latches (5f2567354, which recovers a Shift/Ctrl release the window never received) runs every frame and released sprint whenever the modifier said Ctrl was up. So the controller's sprint was dropped the next frame, before a tick could start it. Holding the right stick to sneak (with the controller's toggle sneak off) went through the same release.

The heal now skips a mapping the controller holds, including a release still waiting for its tick, which is how a quick tap survives. modifiers::reconcile already makes the same check. Keyboard recovery is unchanged: a lost Shift/Ctrl release is still healed.

Kind

  • fix (no label)

Vanilla reference

Vanilla has no controller input. The keyboard behaviour (ToggleKeyMapping sneak/sprint) is unchanged.

Other projects' code

None.

Validation

  • Live, with horizon-ctl's virtual pad on a scratch world: on main 4789fc28f, stick forward + left stick held never sprints; with the fix, both holding and a quick tap sprint and keep sprinting. Ctrl+W still sprints.
  • The author tested a real Xbox controller on macOS: stick-click sprint (tap and hold), held sneak, and a splitscreen guest's stick sprint all work. Keyboard sprint/sneak and alt-tab with nothing held left nothing stuck.
  • No automated controller test covers this yet; a separate PR will add virtual-pad checks for sprint and sneak.

Self-check

pr_ready (tools/pr_ready.py --quick --base FETCH_HEAD on Mac, against FETCH_HEAD at 4789fc28f, 4 min 28 s)

Check Result
Scope ✅ 1 files, +5 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (40 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 51 s)
tests: horizon-client ✅ 588 passed (1 min 42 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 62 affected, to run in CI (--quick)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6470 **Author:** [@martipops](https://github.com/martipops) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pad-sprint-heal` --- ### 📝 Commits (1) - [`0f5e1c8`](https://github.com/horizon-rust/horizon/commit/0f5e1c877380afe8d31b7c8f309ab88e39c980c8) Keep a controller's sprint and sneak held through the modifier heal ### 📊 Changes **1 file changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -2) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Claude Code, Claude Opus 5.5), not by martipops personally. Fixes #6377 ## What and why Clicking the left stick no longer started a sprint (double-tapping forward still did). The stick click acts as the sprint key (Left Ctrl) without setting the OS modifier state. `heal_hold_latches` (`5f2567354`, which recovers a Shift/Ctrl release the window never received) runs every frame and released sprint whenever the modifier said Ctrl was up. So the controller's sprint was dropped the next frame, before a tick could start it. Holding the right stick to sneak (with the controller's toggle sneak off) went through the same release. The heal now skips a mapping the controller holds, including a release still waiting for its tick, which is how a quick tap survives. `modifiers::reconcile` already makes the same check. Keyboard recovery is unchanged: a lost Shift/Ctrl release is still healed. ## Kind - [x] fix (no label) ## Vanilla reference Vanilla has no controller input. The keyboard behaviour (`ToggleKeyMapping` sneak/sprint) is unchanged. ## Other projects' code None. ## Validation - Live, with horizon-ctl's virtual pad on a scratch world: on main `4789fc28f`, stick forward + left stick held never sprints; with the fix, both holding and a quick tap sprint and keep sprinting. Ctrl+W still sprints. - The author tested a real Xbox controller on macOS: stick-click sprint (tap and hold), held sneak, and a splitscreen guest's stick sprint all work. Keyboard sprint/sneak and alt-tab with nothing held left nothing stuck. - No automated controller test covers this yet; a separate PR will add virtual-pad checks for sprint and sneak. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base FETCH_HEAD` on Mac, against FETCH_HEAD at 4789fc28f, 4 min 28 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +5 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (40 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 51 s) | | tests: horizon-client | ✅ 588 passed (1 min 42 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 62 affected, to run in CI (--quick) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6896
No description provided.