Package net.minecraft.client.settings

Examples of net.minecraft.client.settings.KeyBinding


 
  private KeyBinding yetaWrenchMode; 
 
 
  public KeyTracker() {
    glideKey = new KeyBinding("Glider Toggle", Keyboard.KEY_G, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(glideKey);
    soundDetectorKey = new KeyBinding("Sound Locator", Keyboard.KEY_L, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(soundDetectorKey);       
    nightVisionKey = new KeyBinding("Night Vision", Keyboard.KEY_P, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(nightVisionKey);
    gogglesKey = new KeyBinding("Goggles of Revealing", Keyboard.KEY_R, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(gogglesKey);
   
    stepAssistKey = new KeyBinding("Step Assist", Keyboard.KEY_NONE, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(stepAssistKey);
   
    speedKey = new KeyBinding("Speed", Keyboard.KEY_NONE, "Dark Steel Armor");
    ClientRegistry.registerKeyBinding(speedKey);
   
    yetaWrenchMode = new KeyBinding("Yeta Wrench Mode", Keyboard.KEY_Y, "Tools");
    ClientRegistry.registerKeyBinding(yetaWrenchMode);
  }
View Full Code Here


    return EnumSet.of( TickType.CLIENT );
  }

  private static KeyBinding[] keyBindings() {
    return new KeyBinding[] {
        new KeyBinding( "xact.clear", Keyboard.KEY_DOWN ),
        new KeyBinding( "xact.load", Keyboard.KEY_UP ),
        new KeyBinding( "xact.prev", Keyboard.KEY_LEFT ),
        new KeyBinding( "xact.next", Keyboard.KEY_RIGHT ),
        new KeyBinding( "xact.delete", Keyboard.KEY_DELETE ),
        new KeyBinding( "xact.openGrid", Keyboard.KEY_C )
    };
  }
View Full Code Here

  public void keyTick(Type type, boolean tickEnd)
  {
    for(int i = 0; i < keyBindings.length; i++)
    {
      KeyBinding keyBinding = keyBindings[i];
      int keyCode = keyBinding.getKeyCode();
      boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
     
      if(state != keyDown[i] || (state && repeatings[i]))
      {
        if(state)
View Full Code Here

    {
        boolean inChat = FMLClientHandler.instance().getClient().currentScreen instanceof GuiChat;

        for (int i = 0; i < this.keyBindings.length; i++)
        {
            KeyBinding keyBinding = this.keyBindings[i];
            int keyCode = keyBinding.getKeyCode();
            boolean state = inChat ? false : (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode));
            if (state != this.keyDown[i] || state && this.repeatings[i])
            {
                if (state)
                {
                    this.keyDown(type, keyBinding, tickEnd, state != this.keyDown[i]);
                }
                else
                {
                    this.keyUp(type, keyBinding, tickEnd);
                }
                if (tickEnd)
                {
                    this.keyDown[i] = state;
                }
            }
        }
        for (int i = 0; i < this.vKeyBindings.length; i++)
        {
            KeyBinding keyBinding = this.vKeyBindings[i];
            int keyCode = keyBinding.getKeyCode();
            boolean state = keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode);
            if (state != this.keyDown[i + this.keyBindings.length] || state && this.vRepeatings[i])
            {
                if (state)
                {
View Full Code Here

        super(new KeyBinding[] { KeyHandlerClient.galaxyMap, KeyHandlerClient.openFuelGui, KeyHandlerClient.toggleAdvGoggles }, new boolean[] { false, false, false }, KeyHandlerClient.getVanillaKeyBindings(), new boolean[] { false, true, true, true, true, true, true });
    }

    private static KeyBinding[] getVanillaKeyBindings()
    {
        KeyBinding invKey = KeyHandlerClient.mc.gameSettings.keyBindInventory;
        KeyHandlerClient.accelerateKey = KeyHandlerClient.mc.gameSettings.keyBindForward;
        KeyHandlerClient.decelerateKey = KeyHandlerClient.mc.gameSettings.keyBindBack;
        KeyHandlerClient.leftKey = KeyHandlerClient.mc.gameSettings.keyBindLeft;
        KeyHandlerClient.rightKey = KeyHandlerClient.mc.gameSettings.keyBindRight;
        KeyHandlerClient.spaceKey = KeyHandlerClient.mc.gameSettings.keyBindJump;
View Full Code Here

    public void onMouseUp(double x, double y, int button) {
        if (button == 0) {
            if (selectedClickie != null && closestKeybind != null && selectedClickie instanceof ClickableModule) {
                closestKeybind.bindModule((ClickableModule) selectedClickie);
            } else if (selectedClickie != null && selectedClickie instanceof ClickableKeybinding && trashKeybindButton.hitBox(x, y)) {
                KeyBinding binding = ((ClickableKeybinding) selectedClickie).getKeyBinding();
                KeyBinding.keybindArray.remove(binding);
                KeyBinding.hash.removeObject(binding.getKeyCode());
                KeybindManager.getKeybindings().remove(selectedClickie);
            }
            selectedClickie = null;
        }
View Full Code Here

        try {
            name = Keyboard.getKeyName(key);
        } catch (Exception e) {
            name = "???";
        }
        KeyBinding keybind = new KeyBinding(name, key, KeybindKeyHandler.mps);
        ClickableKeybinding clickie = new ClickableKeybinding(keybind, newKeybindButton.getPosition().plus(new MusePoint2D(0, -20)), free);
        KeybindManager.getKeybindings().add(clickie);
    }
View Full Code Here

    public static Set<ClickableKeybinding> getKeybindings() {
        return getInstance().keybindings;
    }

    public static KeyBinding addKeybinding(String keybindDescription, int keycode, MusePoint2D position) {
        KeyBinding kb = new KeyBinding(keybindDescription, keycode, KeybindKeyHandler.mps);
        boolean free = !KeyBinding.hash.containsItem(keycode);
        getInstance().keybindings.add(new ClickableKeybinding(kb, position, free));
        return kb;
    }
View Full Code Here

                    String[] exploded = line.split(":");
                    int id = Integer.parseInt(exploded[0]);
                    if (!KeyBinding.hash.containsItem(id)) {
                        MusePoint2D position = new MusePoint2D(Double.parseDouble(exploded[1]), Double.parseDouble(exploded[2]));
                        boolean free = !KeyBinding.hash.containsItem(id);
                        workingKeybinding = new ClickableKeybinding(new KeyBinding(Keyboard.getKeyName(id), id, KeybindKeyHandler.mps), position, free);
                        getInstance().keybindings.add(workingKeybinding);
                    } else {
                        workingKeybinding = null;
                    }
View Full Code Here

  }
 
  public void load()
  {
    // new KeyBinding registers it rightaway to the list of keys
    this.keyBindingMain = new KeyBinding("MAtmos", 65, "key.categories.misc");
    Minecraft.getMinecraft().gameSettings.keyBindings =
      ArrayUtils.addAll(Minecraft.getMinecraft().gameSettings.keyBindings, this.keyBindingMain);
    this.keyBindingMain.setKeyCode(this.mod.getConfig().getInteger("key.code"));
    KeyBinding.resetKeyBindingArrayAndHash();
   
View Full Code Here

TOP

Related Classes of net.minecraft.client.settings.KeyBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.