Update ControlsUtil.java

This commit is contained in:
simibubi 2022-05-31 03:15:41 +02:00
parent 0088f4f3f3
commit 1b39fd3241

View file

@ -3,6 +3,7 @@ package com.simibubi.create.foundation.utility;
import java.util.Vector; import java.util.Vector;
import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.platform.InputConstants;
import com.simibubi.create.AllKeys;
import net.minecraft.client.KeyMapping; import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -27,11 +28,12 @@ public class ControlsUtil {
} }
public static boolean isActuallyPressed(KeyMapping kb) { public static boolean isActuallyPressed(KeyMapping kb) {
return InputConstants.isKeyDown(Minecraft.getInstance() InputConstants.Key key = kb.getKey();
.getWindow() if (key.getType() == InputConstants.Type.MOUSE) {
.getWindow(), return AllKeys.isMouseButtonDown(key.getValue());
kb.getKey() } else {
.getValue()); return AllKeys.isKeyDown(key.getValue());
}
} }
} }