Posted January 19, 201312 yr Hi everyone; My Keybinding doesent works. This is in the MainMod in the init section KeyBinding[] key = {new KeyBinding("Up", Keyboard.KEY_G), new KeyBinding("Down", Keyboard.KEY_H)}; boolean[] repeat = {false}; KeyBindingRegistry.registerKeyBinding(new MoveblockKeyHandler(key, repeat)); And the probelm is, it says : KEY_G cannot be resolved or is not a field, same with KEY_H and this is in my class named MoveblockKeyHandler package brudigem.minecraft.mypackage; import java.util.EnumSet; import net.minecraft.client.settings.KeyBinding; import net.minecraft.world.World; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.common.TickType; public class MoveblockKeyHandler extends KeyHandler { private EnumSet tickTypes = EnumSet.of(TickType.CLIENT); public MoveblockKeyHandler(KeyBinding[] keyBindings, boolean[] repeatings) { super(keyBindings, repeatings); } @Override public String getLabel() { return "KeyHandler"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } @Override public EnumSet<TickType> ticks() { return tickTypes; } }
January 19, 201312 yr Author ok, thans it works, but now I dont know where the "signal" goes when i press KEY_***, do I have to creat a new class maybe ?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.