Java Code Examples for org.lwjgl.input.Keyboard#KEY_Q
The following examples show how to use
org.lwjgl.input.Keyboard#KEY_Q .
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: KeyboardInput.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
private final boolean checkMagicKey(Deterministic deterministic, boolean event_key_state, int event_key, boolean override, boolean repeat) { boolean keys_enabled = Settings.getSettings().inDeveloperMode() && control_down && shift_down && !repeat; if (event_key_state && (keys_enabled || override)) { // check for special events that shouldn't generate events switch (event_key) { case Keyboard.KEY_RIGHT: AnimationManager.warpTime(LITTLE_WARP); break; case Keyboard.KEY_UP: AnimationManager.warpTime(MEDIUM_WARP); break; case Keyboard.KEY_PRIOR: AnimationManager.warpTime(LARGE_WARP); break; case Keyboard.KEY_Q: System.out.println("Exit forced with ctrl+Q"); Renderer.shutdown(); break; case Keyboard.KEY_SPACE: AnimationManager.toggleTimeStop(); break; case Keyboard.KEY_END: System.out.println("WARP UNTIL END OF EVENT LOG"); AnimationManager.warpTime(GOTO_END_OF_LOG_WARP); break; default: break; } } return keys_enabled; }
Example 2
Source File: TestUtils.java From slick2d-maven with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * Game loop update */ public void update() { while (Keyboard.next()) { if (Keyboard.getEventKeyState()) { if (Keyboard.getEventKey() == Keyboard.KEY_Q) { // play as a one off sound effect oggEffect.playAsSoundEffect(1.0f, 1.0f, false); } if (Keyboard.getEventKey() == Keyboard.KEY_W) { // replace the music thats curretly playing with // the ogg oggStream.playAsMusic(1.0f, 1.0f, true); } if (Keyboard.getEventKey() == Keyboard.KEY_E) { // replace the music thats curretly playing with // the mod modStream.playAsMusic(1.0f, 1.0f, true); } if (Keyboard.getEventKey() == Keyboard.KEY_R) { // play as a one off sound effect aifEffect.playAsSoundEffect(1.0f, 1.0f, false); } if (Keyboard.getEventKey() == Keyboard.KEY_T) { // play as a one off sound effect wavEffect.playAsSoundEffect(1.0f, 1.0f, false); } } } // polling is required to allow streaming to get a chance to // queue buffers. SoundStore.get().poll(0); }
Example 3
Source File: ActionButtonPanel.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
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; }