Jump to content

Recommended Posts

Posted

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;
                }



        }

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.