Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -581,4 +591,4 @@ private void initMisc() {
add(new Spam());
add(new Swarm());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public boolean canBindTo(boolean isKey, int value, int modifiers) {

public boolean matches(InputConstants.Key key, Set<Modifier> 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);
}

Expand Down Expand Up @@ -275,4 +275,4 @@ private static InputConstants.Key mouse(int button) {
return InputConstants.Type.MOUSE.getOrCreate(button);
}

}
}