Skip to content

Commit

Permalink
Updated to 1.16.2 and fixed GLFW invalid key error
Browse files Browse the repository at this point in the history
  • Loading branch information
Minenash committed Aug 21, 2020
1 parent 945bd67 commit 50aae5b
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.minenash.rebind_all_the_keys.mixin;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.util.InputUtil;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Environment(EnvType.CLIENT)
@Mixin(InputUtil.class)
public class InputKeyMixin {

@Inject(method = "isKeyPressed", at = @At("HEAD"), cancellable = true)
private static void silenceError(long handle, int key, CallbackInfoReturnable<Boolean> callbackInfo) {
if (key < -1) {
callbackInfo.setReturnValue(false);
callbackInfo.cancel();
}
}
}

0 comments on commit 50aae5b

Please sign in to comment.