1
0
forked from Clones/Controlify

swap hands and shift click binds

This commit is contained in:
isXander
2023-02-13 22:05:00 +00:00
parent bcecc59c28
commit 6332e9c7bc
3 changed files with 13 additions and 8 deletions

View File

@ -3,6 +3,7 @@ package dev.isxander.controlify.mixins.feature.virtualmouse;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.mojang.blaze3d.platform.InputConstants;
import dev.isxander.controlify.Controlify;
import net.minecraft.client.Minecraft;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@ -12,8 +13,10 @@ public class InputConstantsMixin {
// must modify isKeyDown here because Screen.hasShiftDown has some instances that ask for this directly.
@ModifyReturnValue(method = "isKeyDown", at = @At("RETURN"))
private static boolean modifyIsKeyDown(boolean keyDown, long window, int key) {
if (key == GLFW.GLFW_KEY_LEFT_SHIFT) {
return keyDown || Controlify.instance().currentController().bindings().VMOUSE_SHIFT.held();
if (key == GLFW.GLFW_KEY_LEFT_SHIFT && window == Minecraft.getInstance().getWindow().getWindow()) {
return keyDown
|| Controlify.instance().currentController().bindings().VMOUSE_SHIFT_CLICK.held()
|| Controlify.instance().currentController().bindings().VMOUSE_SHIFT.held();
}
return keyDown;