Java Code Examples for org.lwjgl.input.Keyboard#KEY_N
The following examples show how to use
org.lwjgl.input.Keyboard#KEY_N .
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: KeybindManager.java From MediaMod with GNU General Public License v3.0 | 5 votes |
/** * Fired when you want to register keybinds * * @see MediaMod#preInit(FMLPreInitializationEvent) */ public void register() { // Initialize and declare keybinds INSTANCE.disableKeybind = new KeyBinding("key.disableKeybind", Keyboard.KEY_P, "key.categories.mediamod"); INSTANCE.menuKeybind = new KeyBinding("key.menuKeybind", Keyboard.KEY_M, "key.categories.mediamod"); INSTANCE.skipKeybind = new KeyBinding("key.skipKeybind", Keyboard.KEY_F, "key.categories.mediamod"); INSTANCE.pausePlayKeybind = new KeyBinding("key.pausePlayKeybind", Keyboard.KEY_N, "key.categories.mediamod"); ClientRegistry.registerKeyBinding(disableKeybind); ClientRegistry.registerKeyBinding(menuKeybind); ClientRegistry.registerKeyBinding(skipKeybind); ClientRegistry.registerKeyBinding(pausePlayKeybind); }
Example 2
Source File: ConfirmationPopup.java From Hyperium with GNU Lesser General Public License v3.0 | 5 votes |
@InvokeEvent public void onKeypress(KeyPressEvent e) { if (currentConfirmation == null || Minecraft.getMinecraft().currentScreen != null) return; if (e.getKey() == Keyboard.KEY_Y) currentConfirmation.callback.accept(true); else if (e.getKey() == Keyboard.KEY_N) currentConfirmation.callback.accept(false); }
Example 3
Source File: SelectionDelegate.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
public final void keyPressed(KeyboardEvent event) { getCamera().keyPressed(event); int army_number = 0; switch (event.getKeyCode()) { case Keyboard.KEY_SPACE: case Keyboard.KEY_NUMPAD5: if (!map_mode) { selection = false; getViewer().getPicker().pickRotate((GameCamera)getCamera()); map_mode = true; if (observer) observer_label.remove(); else getActionButtonPanel().remove(); getCamera().disable(); setCamera(new MapCamera(this, game_camera)); getCamera().enable(); } break; case Keyboard.KEY_TAB: if (!observer) { Notification n = getViewer().getNotificationManager().getLatestNotification(); if (n != null) { if (getCamera() instanceof GameCamera) getGUIRoot().pushDelegate(new JumpDelegate(getViewer(), (GameCamera)getCamera(), n.getX(), n.getY())); else if (getCamera() instanceof MapCamera) ((MapCamera)getCamera()).mapGoto(n.getX(), n.getY(), true); } } break; case Keyboard.KEY_9: army_number++; case Keyboard.KEY_8: army_number++; case Keyboard.KEY_7: army_number++; case Keyboard.KEY_6: army_number++; case Keyboard.KEY_5: army_number++; case Keyboard.KEY_4: army_number++; case Keyboard.KEY_3: army_number++; case Keyboard.KEY_2: army_number++; case Keyboard.KEY_1: army_number++; case Keyboard.KEY_0: if (!map_mode && !observer) { if (event.isControlDown()) { getViewer().getSelection().setShortcutArmy(army_number); } else { boolean selected = getViewer().getSelection().enableShortcutArmy(army_number); if (selected && event.getNumClicks() > 1) { Set set = getViewer().getSelection().getCurrentSelection().getSet(); if (set.size() > 0) { Selectable s = (Selectable)set.iterator().next(); getGUIRoot().pushDelegate(new JumpDelegate(getViewer(), (GameCamera)getCamera(), s.getPositionX(), s.getPositionY())); } } } } break; case Keyboard.KEY_RETURN: if (!chat_visible) chat_form.setReceivers(!event.isShiftDown()); break; case Keyboard.KEY_B: if (event.isControlDown() && !map_mode && !observer) { getGUIRoot().pushDelegate(new BeaconDelegate(getViewer(), (GameCamera)getCamera())); } break; case Keyboard.KEY_N: nextIdlePeon(); break; case Keyboard.KEY_F: case Keyboard.KEY_Z: if (!map_mode) super.keyPressed(event); break; default: if (map_mode || observer) { super.keyPressed(event); } else { if (!getActionButtonPanel().doKeyPressed(event)) super.keyPressed(event); } break; } }
Example 4
Source File: Example17_2.java From LWJGL-OpenGL-Tutorials with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public void keyPressed(int key, char c) { switch(key) { case Keyboard.KEY_SPACE: lightViewPole.reset(); break; case Keyboard.KEY_T: drawCameraPos = !drawCameraPos; break; case Keyboard.KEY_G: showOtherLights = !showOtherLights; break; case Keyboard.KEY_H: currSampler = (currSampler + 1) % NUM_SAMPLERS; break; case Keyboard.KEY_P: timer.togglePause(); break; case Keyboard.KEY_Y: currFOVIndex = Math.min(currFOVIndex + 1, lightFOVS.length - 1); System.out.println("Curr FOV: " + lightFOVS[currFOVIndex]); break; case Keyboard.KEY_N: currFOVIndex = Math.max(currFOVIndex - 1, 0); System.out.println("Curr FOV: " + lightFOVS[currFOVIndex]); break; case Keyboard.KEY_RETURN: try { loadAndSetupScene(); } catch(Exception exc) { exc.printStackTrace(); destroy(); } break; } int posibleIndex = c - '1'; if(posibleIndex >= 0 && posibleIndex < NUM_LIGHT_TEXTURES) { currTextureIndex = posibleIndex; System.out.println(texDefs[currTextureIndex][1]); } }