package com.infinityraider.infinitylib.modules.keyboard;

import com.google.common.collect.ImmutableList;
import com.infinityraider.infinitylib.modules.Module;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.List;

public class ModuleKeyboard extends Module {
    private static final ModuleKeyboard INSTANCE = new ModuleKeyboard();

    public static ModuleKeyboard getInstance() {
        return INSTANCE;
    }

    private ModuleKeyboard() {}

    @OnlyIn(Dist.CLIENT)
    public void registerKeyListener(IKeyListener listener) {
        KeyEventHandler.getInstance().registerListener(listener);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyPressed(int key) {
        return KeyEventHandler.getInstance().isKeyPressed(key);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyRepeated(int key) {
        return KeyEventHandler.getInstance().isKeyRepeated(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyHoldDownTime(int key) {
        return KeyEventHandler.getInstance().getKeyHoldDownTime(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyModifier(int key) {
        return KeyEventHandler.getInstance().getKeyModifier(key);
    }

    @Override
    @OnlyIn(Dist.CLIENT)
    public List<Object> getClientEventHandlers() {
        return ImmutableList.of(KeyEventHandler.getInstance());
    }
}

@@ -153,16 +153,65 @@
 Module;%0A
+import net.minecraft.client.settings.KeyBinding;%0A
 import n
@@ -707,32 +707,175 @@
 stener);%0A    %7D%0A%0A
+    @OnlyIn(Dist.CLIENT)%0A    public boolean isKeyPressed(KeyBinding key) %7B%0A        return this.isKeyPressed(key.getKey().getKeyCode());%0A    %7D%0A%0A
     @OnlyIn(Dist

Add method to Keyboard Module to fetch KeyBinding state