Skip to content

Instantly share code, notes, and snippets.

@ZornTaov
Created January 13, 2014 14:07
Show Gist options
  • Save ZornTaov/8400854 to your computer and use it in GitHub Desktop.
Save ZornTaov/8400854 to your computer and use it in GitHub Desktop.
package zornco.fps;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
public class KeyHandler {
static KeyBinding show = new KeyBinding("Show Menu", Keyboard.KEY_Y, "key.categories.gameplay");
private static boolean isRegistered = false;
public KeyHandler() {
ClientRegistry.registerKeyBinding(show);
isRegistered = true;
}
@SubscribeEvent
public void keypress(KeyInputEvent event)
{
if(Keyboard.getEventKey() == show.func_151463_i())
{
System.out.println("ding");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment