Java Code Examples for org.lwjgl.input.Keyboard#KEY_I

The following examples show how to use org.lwjgl.input.Keyboard#KEY_I . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiProgrammer.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void keyTyped(char key, int keyCode){
    super.keyTyped(key, keyCode);

    if(Keyboard.KEY_I == keyCode && Loader.isModLoaded(ModIds.IGWMOD)) {
        onIGWAction();
    }
    if(Keyboard.KEY_R == keyCode) {
        if(exportButton.getBounds().contains(lastMouseX, lastMouseY)) {
            NetworkHandler.sendToServer(new PacketGuiButton(0));
        }
    }
    if(Keyboard.KEY_SPACE == keyCode) {
        toggleShowWidgets();
    }
    if(Keyboard.KEY_DELETE == keyCode) {
        IProgWidget widget = programmerUnit.getHoveredWidget(lastMouseX, lastMouseY);
        if(widget != null) {
            te.progWidgets.remove(widget);
            NetworkHandler.sendToServer(new PacketProgrammerUpdate(te));
        }
    }
    if(Keyboard.KEY_Z == keyCode) {
        NetworkHandler.sendToServer(new PacketGuiButton(undoButton.id));
    }
    if(Keyboard.KEY_Y == keyCode) {
        NetworkHandler.sendToServer(new PacketGuiButton(redoButton.id));
    }
}
 
Example 2
Source File: ActionButtonPanel.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
public final boolean doKeyPressed(KeyboardEvent event) {
	switch (event.getKeyCode()) {
		case Keyboard.KEY_M:
		case Keyboard.KEY_Q:
			if (current_unit)
				return true;
			break;
		case Keyboard.KEY_A:
			if ((current_unit || current_armory || current_tower) && !event.isControlDown())
				return true;
			break;
		case Keyboard.KEY_P:
			if (current_quarters)
				return true;
			if (current_unit)
				break;
		case Keyboard.KEY_G:
		case Keyboard.KEY_T:
			if (current_unit || current_armory)
				return true;
		case Keyboard.KEY_C:
		case Keyboard.KEY_I:
		case Keyboard.KEY_W:
		case Keyboard.KEY_ESCAPE:
			if (current_armory)
				if (current_submenu == harvest_group ||
						current_submenu == build_group ||
						current_submenu == army_group ||
						current_submenu == transport_group)
					return true;
			break;
		case Keyboard.KEY_R:
			if (current_armory || current_quarters)
				return true;
			break;
		case Keyboard.KEY_X:
			if (current_tower)
				return true;
			break;
		default:
			break;
	}
	return false;
}
 
Example 3
Source File: ActionButtonPanel.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
public final boolean doKeyReleased(KeyboardEvent event) {
	switch (event.getKeyCode()) {
		case Keyboard.KEY_C:
			if (current_armory) {
				if (current_submenu == harvest_group) {
					harvest_rubber_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == build_group) {
					build_weapon_rubber_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == army_group) {
					army_warrior_rubber_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == transport_group) {
					transport_rubber_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else {
					break;
				}
				return true;
			}
			break;
		case Keyboard.KEY_P:
			if (current_quarters) {
				quarters_peon_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				return true;
			}
			if (current_armory) {
				if (current_submenu == army_group) {
					army_peon_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else {
					break;
				}
				return true;
			}
			break;
		case Keyboard.KEY_I:
			if (current_armory) {
				if (current_submenu == harvest_group) {
					harvest_iron_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == build_group) {
					build_weapon_iron_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == army_group) {
					army_warrior_iron_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == transport_group) {
					transport_iron_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else {
					break;
				}
				return true;
			}
			break;
		case Keyboard.KEY_R:
			if (current_armory) {
				if (current_submenu == harvest_group) {
					harvest_rock_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == build_group) {
					build_weapon_rock_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == army_group) {
					army_warrior_rock_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == transport_group) {
					transport_rock_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else {
					break;
				}
				return true;
			}
			break;
		case Keyboard.KEY_T:
			if (current_armory) {
				if (current_submenu == null) {
					transport_button.mouseClickedAll(LocalInput.LEFT_BUTTON, 0, 0, 1);
				} else {
					break;
				}
				return true;
			}
			break;
		case Keyboard.KEY_W:
			if (current_armory) {
				if (current_submenu == harvest_group) {
					harvest_tree_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else if (current_submenu == transport_group) {
					transport_tree_button.shortcutReleased(event.isShiftDown(), event.isControlDown());
				} else {
					break;
				}
			return true;
			}
			break;
		default:
			break;
	}
	return false;
}