Java Code Examples for com.badlogic.gdx.Input.Keys#NUM_9
The following examples show how to use
com.badlogic.gdx.Input.Keys#NUM_9 .
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: GuiRenderer.java From Cubes with MIT License | 6 votes |
@Override public boolean keyDown(int keycode) { if (functionKeys(keycode)) return true; if (keycode == blocksMenu) { toggleInventory(); return true; } int selected = -1; if (keycode == Keys.NUM_1) selected = 0; if (keycode == Keys.NUM_2) selected = 1; if (keycode == Keys.NUM_3) selected = 2; if (keycode == Keys.NUM_4) selected = 3; if (keycode == Keys.NUM_5) selected = 4; if (keycode == Keys.NUM_6) selected = 5; if (keycode == Keys.NUM_7) selected = 6; if (keycode == Keys.NUM_8) selected = 7; if (keycode == Keys.NUM_9) selected = 8; if (selected != -1) { Cubes.getClient().player.getInventory().hotbarSelected = selected; Cubes.getClient().player.getInventory().sync(); return true; } return false; }
Example 2
Source File: KeyMap.java From seventh with GNU General Public License v2.0 | 6 votes |
public String humanReadableKey(int key) { switch(key) { case Keys.NUM_0: case Keys.NUM_1: case Keys.NUM_2: case Keys.NUM_3: case Keys.NUM_4: case Keys.NUM_5: case Keys.NUM_6: case Keys.NUM_7: case Keys.NUM_8: case Keys.NUM_9: return Integer.toString(key - Keys.NUM_0); default: return keyString(key); } }