Package org.spoutcraft.client.controls

Examples of org.spoutcraft.client.controls.SimpleKeyBindingManager


    }
    if (btn.equals(doneButton)) {
      item.setTitle(commandName.getText());
      item.setDelay(Integer.parseInt(delayText.getText()));
      if (!item.getTitle().equals("") && item.getKey() != -1) {
        SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager();
        manager.unregisterShortcut(item);
        manager.registerShortcut(item);
      }
      mc.displayGuiScreen(parent);
      parent.getModel().refresh();
    }
    if (btn.equals(addButton)) {
View Full Code Here


  public ControlsModel getModel() {
    return model;
  }

  public void deleteCurrentControl() {
    SimpleKeyBindingManager man = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager();
    ControlsBasicItem item = model.getItem(view.getSelectedRow());
    ShortcutBindingItem sh = null;
    if (item != null && item instanceof ShortcutBindingItem) {
      sh = (ShortcutBindingItem) item;
    }
    KeyBindingItem binding = null;
    if (item != null && item instanceof KeyBindingItem) {
      binding = (KeyBindingItem) item;
    }
    if (sh != null) {
      man.unregisterShortcut(sh.getShortcut());
      man.save();
    } else if (binding != null) {
      man.unregisterControl(binding.getBinding());
      man.save();
      model.refresh();
    } else {
      item.setKey(-128);
    }
    model.refresh();
View Full Code Here

TOP

Related Classes of org.spoutcraft.client.controls.SimpleKeyBindingManager

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.