Skip to content

Commit

Permalink
Use Forge API to catch keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Asek3 committed Sep 5, 2023
1 parent a96e7a1 commit 4524b21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 34 deletions.
8 changes: 8 additions & 0 deletions src/main/java/net/coderbot/iris/Iris.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.util.zip.ZipError;
import java.util.zip.ZipException;

import net.minecraftforge.client.event.InputEvent;
import net.minecraftforge.common.MinecraftForge;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;

Expand Down Expand Up @@ -98,6 +100,8 @@ public class Iris {
public Iris() {
try {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onInitializeClient);

MinecraftForge.EVENT_BUS.addListener(this::onKeyInput);
}catch(Exception ignored) {}
}

Expand Down Expand Up @@ -143,6 +147,10 @@ public void onInitializeClient(final FMLClientSetupEvent event) {
ClientRegistry.registerKeyBinding(shaderpackScreenKeybind);
}

public void onKeyInput(InputEvent.KeyInputEvent event) {
handleKeybinds(Minecraft.getInstance());
}

/**
* Called once RenderSystem#initRenderer has completed. This means that we can safely access OpenGL.
*/
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/net/coderbot/iris/mixin/MixinMinecraft_Keybinds.java

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/mixins.oculus.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"MixinItemBlockRenderTypes",
"MixinItemInHandRenderer",
"MixinLevelRenderer",
"MixinMinecraft_Keybinds",
"MixinMinecraft_Images",
"MixinMinecraft_PipelineManagement",
"MixinModelViewBobbing",
Expand Down

0 comments on commit 4524b21

Please sign in to comment.