Skip to content

Instantly share code, notes, and snippets.

@WhiteAbeLincoln
Created July 10, 2014 22:38
Show Gist options
  • Save WhiteAbeLincoln/a7674bbaaef456b2646d to your computer and use it in GitHub Desktop.
Save WhiteAbeLincoln/a7674bbaaef456b2646d to your computer and use it in GitHub Desktop.
Key Bindings for minecraft 1.7
package com.abe.tutorial;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.client.registry.ClientRegistry;
import net.minecraft.client.settings.KeyBinding;
public class KeyBindings {
// Declare KeyBinding pong
public static KeyBinding pong;
public static void init() {
// Define the "pong" binding, with (unlocalized) name "key.pong" and
// the category with (unlocalized) name "key.categories.mymod" and
// key code 25 ("P", LWJGL constant: Keyboard.KEY_P)
pong = new KeyBinding("key.pong", Keyboard.KEY_P, "key.categories.mymod");
// Register KeyBinding to the ClientRegistry
ClientRegistry.registerKeyBinding(pong);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment