[GH-ISSUE #2702] Toggle Sprint treats key as being held down #663

Closed
opened 2026-11-02 15:40:55 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @vinays6 on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2702

If you set your Sprint behavior to Hold, then set your sprint key to Left Control, some weird behavior happens.

I.e. if your toggle sprint is on but Left Control isn't actively being pressed down, pressing the drop key (say Q) drops the entire stack (ctrl-Q action). I believe this is because the game simulates the actual key being pressed down for toggle sprint?

Toggle sneak is likely to have the same issue, and it might happen for keys other than left control.

Originally created by @vinays6 on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2702 If you set your Sprint behavior to Hold, then set your sprint key to Left Control, some weird behavior happens. I.e. if your toggle sprint is on but Left Control isn't actively being pressed down, pressing the drop key (say Q) drops the entire stack (ctrl-Q action). I believe this is because the game simulates the actual key being pressed down for toggle sprint? Toggle sneak is likely to have the same issue, and it might happen for keys other than left control.
Author
Owner

@kacpherek commented on GitHub (Oct 27, 2026):

Thanks vinays6 for the report! A fix is up in #2725: the drop key now checks the physical Control keys, so a toggled sprint no longer counts as Ctrl. It's waiting for review.

<!-- gh-comment-id:6439010429 --> @kacpherek commented on GitHub (Oct 27, 2026): Thanks vinays6 for the report! A fix is up in #2725: the drop key now checks the physical Control keys, so a toggled sprint no longer counts as Ctrl. It's waiting for review.
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: Confirmed — treating the sprint key as held for toggle sprint makes ctrl-Q drop the whole stack because the key looks pressed. The sprint binding should only simulate sprint input, not the physical key. Leaving to the maintainer.

<!-- gh-comment-id:6443441956 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Confirmed — treating the sprint key as held for toggle sprint makes ctrl-Q drop the whole stack because the key looks pressed. The sprint binding should only simulate sprint input, not the physical key. Leaving to the maintainer.
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: The specific mechanism is already handled on main — drop_whole_stack reads only physical_keys (real key presses), and the test stack_drop_requires_physical_ctrl_even_with_sprint_latched asserts ctrl+Q does not drop the stack when the sprint key is latched but ctrl isn't physically held. If you still see it on the current build it's a different path (e.g. the drop key's modifier reading the sprint state, not the physical ctrl) — a repro of which keys were bound would pin it down.

<!-- gh-comment-id:6444238090 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: The specific mechanism is already handled on main — `drop_whole_stack` reads only `physical_keys` (real key presses), and the test `stack_drop_requires_physical_ctrl_even_with_sprint_latched` asserts ctrl+Q does *not* drop the stack when the sprint key is latched but ctrl isn't physically held. If you still see it on the current build it's a different path (e.g. the drop key's modifier reading the sprint state, not the physical ctrl) — a repro of which keys were bound would pin it down.
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#663
No description provided.