public static void update() {
		while (Keyboard.next()) {
			int eventKey = Keyboard.getEventKey();

			if (0 <= eventKey && eventKey < NUM_KEYCODES) {
				lastKeys[eventKey] = Keyboard.getEventKeyState();
			}
		}

		while (Mouse.next()) {
			int eventButton = Mouse.getEventButton();

			if (0 <= eventButton && eventButton < NUM_MOUSEBUTTONS) {
				lastMouse[eventButton] = Mouse.getEventButtonState();
			}
		}
	}