1
0
forked from Clones/Controlify

compound binds, complete vanilla compat, better vmouse screen handling, controller uuid, beta notice screen, configurable movement keys, vmouse shift key, icon, optimize controller save/load

This commit is contained in:
isXander
2023-02-05 14:55:20 +00:00
parent 9c7972c971
commit 6c5108469c
62 changed files with 831 additions and 137 deletions

View File

@ -0,0 +1,21 @@
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 org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(InputConstants.class)
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();
}
return keyDown;
}
}