Skip to content

Commit

Permalink
refactor: use glfw constants everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Jan 21, 2024
1 parent aca2e44 commit 12929d1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.pyke.vitri.finorza.inference.api.KeyboardHandlerAccessor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

Expand All @@ -11,6 +12,6 @@ public class ScreenMixin {
@Overwrite // need this override for container GUIs
public static boolean hasShiftDown() {
final KeyboardHandlerAccessor handler = ((KeyboardHandlerAccessor) Minecraft.getInstance().keyboardHandler);
return handler.vitri$isKeyPressed(340) || handler.vitri$isKeyPressed(344);
return handler.vitri$isKeyPressed(GLFW.GLFW_KEY_LEFT_SHIFT) || handler.vitri$isKeyPressed(GLFW.GLFW_KEY_RIGHT_SHIFT);
}
}

0 comments on commit 12929d1

Please sign in to comment.