diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java index 58ad25fdf..8010fe460 100644 --- a/src/main/java/com/simibubi/create/AllKeys.java +++ b/src/main/java/com/simibubi/create/AllKeys.java @@ -63,6 +63,12 @@ public enum AllKeys { .getWindow(), key) != 0; } + public static boolean isMouseButtonDown(int button){ + return GLFW.glfwGetMouseButton(Minecraft.getInstance() + .getWindow() + .getWindow(), button) != 0; + } + public static boolean ctrlDown() { return Screen.hasControlDown(); } diff --git a/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerClientHandler.java b/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerClientHandler.java index 1c3452d7f..1671bda41 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerClientHandler.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerClientHandler.java @@ -6,6 +6,8 @@ import java.util.HashSet; import java.util.List; import java.util.Vector; +import com.simibubi.create.AllKeys; + import org.lwjgl.glfw.GLFW; import com.mojang.blaze3d.platform.InputConstants; @@ -116,11 +118,10 @@ public class LinkedControllerClientHandler { } protected static boolean isActuallyPressed(KeyMapping kb) { - return InputConstants.isKeyDown(Minecraft.getInstance() - .getWindow() - .getWindow(), - kb.getKey() - .getValue()); + if(kb.matchesMouse(kb.getKey().getValue())) + return AllKeys.isMouseButtonDown(kb.getKey().getValue()); + else + return AllKeys.isKeyDown(kb.getKey().getValue()); } public static void tick() {