mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Fixed the mouse button problems with the linked controller. (#3069)
* Fixed the mouse button problems with the linked controller. (Closes #2807) * Now with added elegance * I'm here I might as well tie up some loose ends * Compacting out some spaces * This was probably the way it was for a good reason
This commit is contained in:
parent
329be0d948
commit
799ebb9fa0
2 changed files with 12 additions and 5 deletions
|
@ -63,6 +63,12 @@ public enum AllKeys {
|
||||||
.getWindow(), key) != 0;
|
.getWindow(), key) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMouseButtonDown(int button){
|
||||||
|
return GLFW.glfwGetMouseButton(Minecraft.getInstance()
|
||||||
|
.getWindow()
|
||||||
|
.getWindow(), button) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean ctrlDown() {
|
public static boolean ctrlDown() {
|
||||||
return Screen.hasControlDown();
|
return Screen.hasControlDown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import com.simibubi.create.AllKeys;
|
||||||
|
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
|
@ -116,11 +118,10 @@ public class LinkedControllerClientHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean isActuallyPressed(KeyMapping kb) {
|
protected static boolean isActuallyPressed(KeyMapping kb) {
|
||||||
return InputConstants.isKeyDown(Minecraft.getInstance()
|
if(kb.matchesMouse(kb.getKey().getValue()))
|
||||||
.getWindow()
|
return AllKeys.isMouseButtonDown(kb.getKey().getValue());
|
||||||
.getWindow(),
|
else
|
||||||
kb.getKey()
|
return AllKeys.isKeyDown(kb.getKey().getValue());
|
||||||
.getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void tick() {
|
public static void tick() {
|
||||||
|
|
Loading…
Reference in a new issue