diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index 17e6b9214f..88e556c81c 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -279,7 +279,17 @@ private void onMouseClick(MouseClickEvent event) { private void onAction(boolean isKey, int value, int modifiers, boolean isPress) { if (mc.gui.screen() != null || Input.isKeyPressed(InputConstants.KEY_F3)) return; + boolean moddedBindMatched = false; for (Module module : moduleInstances.values()) { + if (module.keybind.hasMods() && module.keybind.matches(isKey, value, modifiers)) { + moddedBindMatched = true; + break; + } + } + + for (Module module : moduleInstances.values()) { + if (!module.keybind.hasMods() && moddedBindMatched) continue; + if (module.keybind.matches(isKey, value, modifiers) && (isPress || (module.toggleOnBindRelease && module.isActive()))) { module.toggle(); module.sendToggledMsg(); @@ -581,4 +591,4 @@ private void initMisc() { add(new Spam()); add(new Swarm()); } -} +} \ No newline at end of file diff --git a/src/main/java/meteordevelopment/meteorclient/utils/misc/Keybind.java b/src/main/java/meteordevelopment/meteorclient/utils/misc/Keybind.java index daf7b59f7f..84543b0b47 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/misc/Keybind.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/misc/Keybind.java @@ -149,7 +149,7 @@ public boolean canBindTo(boolean isKey, int value, int modifiers) { public boolean matches(InputConstants.Key key, Set modifiers) { if (!isSet() || !this.key.equals(key)) return false; - if (!hasMods()) return modifiers.stream().noneMatch(m -> m == Modifier.SHIFT || m == Modifier.CONTROL || m == Modifier.ALT || m == Modifier.SUPER); + if (!hasMods()) return true; return this.modifiers.equals(modifiers); } @@ -275,4 +275,4 @@ private static InputConstants.Key mouse(int button) { return InputConstants.Type.MOUSE.getOrCreate(button); } -} +} \ No newline at end of file