Skip to content

Commit

Permalink
Remove "Middle Click to Unbind"
Browse files Browse the repository at this point in the history
Because Vanilla actually has a way to unbind keys: "Select and Press Esc to Unbind"
  • Loading branch information
EnnuiL committed Dec 11, 2021
1 parent 33571a4 commit 2b96310
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;

import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -28,12 +27,10 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.option.KeyBindingListWidget;
import net.minecraft.client.gui.widget.option.KeyBindingListWidget.KeyBindingEntry;
Expand Down Expand Up @@ -130,20 +127,4 @@ private Text addConflictIndicator(Text originalText) {
public List<Text> getConflictTooltips() {
return this.quilt$conflictTooltips;
}

@Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
private void addMiddleButtonBehavior(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
if (button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE) {
if (this.bindButton.active && this.bindButton.visible) {
if (((ClickableWidgetAccessor) this.bindButton).callClicked(mouseX, mouseY)) {
MinecraftClient client = ((EntryListWidgetAccessor) (Object) field_2742).getClient();
this.bindButton.playDownSound(client.getSoundManager());
this.binding.setBoundKey(InputUtil.UNKNOWN_KEY);
KeyBinding.updateKeysByCode();

cir.setReturnValue(true);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"package": "org.quiltmc.qsl.key.bindings.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
"client.ClickableWidgetAccessor",
"client.EntryListWidgetAccessor",
"client.GameOptionsAccessor",
"client.GameOptionsMixin",
Expand Down

0 comments on commit 2b96310

Please sign in to comment.