Skip to content

Fix binds without modifiers not matching while sprinting or crouching - #6671

Open
sandwichmm wants to merge 1 commit into
MeteorDevelopment:masterfrom
sandwichmm:master
Open

sandwichmm wants to merge 1 commit into
MeteorDevelopment:masterfrom
sandwichmm:master

Conversation

@sandwichmm

@sandwichmm sandwichmm commented Sep 20, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix

Description

Summary

Root cause: A prior fix (#6586) made Keybind#matches reject any no-modifier bind if any modifier key was currently held, to stop Ctrl+G from also firing a plain G bind. But Minecraft's default controls tie Sprint to Ctrl and Sneak to Shift, so simply sprinting or crouching set those modifier bits, causing every plain keybind to stop responding whenever the player moved that way.

Fix: Split the concern into the two places it actually belongs.

  1. Keybind.java: matches() no longer disqualifies a no-modifier bind based on which modifiers happen to be held. A bind with no modifiers now matches on the key alone, exactly as before Fixed keybind modifiers!!!!!!!  #6586. This restores plain binds while sprinting/crouching.

  2. Modules.java: the "don't double-fire" behavior that Fixed keybind modifiers!!!!!!!  #6586 was trying to achieve is moved to where binds are actually dispatched, in onAction(). Before checking plain binds, it first checks whether any bind with modifiers matches the current event; if one does, plain (no-modifier) binds are skipped for that event only. This preserves the original intent, so Ctrl+G still fires only the chorded bind, not both, without punishing every plain bind whenever an unrelated modifier is incidentally held.

Net effect:

  • Plain binds (e.g. G) work correctly while sprinting, crouching, or holding any other modifier for an unrelated reason.
  • Chorded binds (e.g. Ctrl+G) still fire only when their exact modifier combination is pressed.
  • If both G and Ctrl+G are bound, pressing Ctrl+G triggers only the Ctrl+G module, not both, matching the original goal of Fixed keybind modifiers!!!!!!!  #6586.

Related issues

#6648
#6652

How Has This Been Tested?

https://github.com/user-attachments/assets/9afe6061-ef1e-4cee-ad9a-0e3e5fb9d096
In the uploaded video, you can see me holding my sprint keybind (shift) and the module woking whilst im pressing it.

Checklist:

  • [* ] My code follows the style guidelines of this project.
  • [ *] I have added comments to my code in more complex areas.
  • [ *] I have tested the code in both development and production environments.

…king holds Shift and sprinting holds Ctrl, which caused everyplain keybind to stop matching while sprinting or crouching.Keybind#matches no longer rejects a no-modifier bind just because amodifier is currently held; Modules#onAction now handles precedencebetween plain and chorded binds instead, so Ctrl+G still only firesthe chorded module.(Apologies i accidentally wiped the previous commit) Fixes MeteorDevelopment#6648
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant