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

The following examples show how to use org.lwjgl.input.Keyboard#KEY_RMENU . 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 vote down vote up
public final boolean doPoll(GUIRoot gui_root) {
	Deterministic deterministic = LocalEventQueue.getQueue().getDeterministic();
	LocalInput local_input = LocalInput.getLocalInput();
	boolean result = false;
	Keyboard.poll();
	while (deterministic.log(Keyboard.next())) {
		result = true;
		int event_key = deterministic.log(Keyboard.getEventKey());
		boolean event_key_state = deterministic.log(Keyboard.getEventKeyState());
		char event_character = deterministic.log(Keyboard.getEventCharacter());
		boolean repeat_event = deterministic.log(Keyboard.isRepeatEvent());
		switch (event_key) {
			case Keyboard.KEY_LSHIFT:
			case Keyboard.KEY_RSHIFT:
				shift_down = event_key_state;
				break;
			case Keyboard.KEY_LCONTROL:
			case Keyboard.KEY_RCONTROL:
				control_down = event_key_state;
				break;
			case Keyboard.KEY_LMENU:
			case Keyboard.KEY_RMENU:
				menu_down = event_key_state;
				break;
		}
		if (checkMagicKey(deterministic, event_key_state, event_key, false, repeat_event))
			continue;
		if (event_key == Keyboard.KEY_NONE) {
			local_input.keyTyped(gui_root, event_key, event_character);
		} else if (event_key_state) {
			local_input.keyPressed(gui_root, event_key, event_character, shift_down, control_down, menu_down, repeat_event);
		} else {
			local_input.keyReleased(gui_root, event_key, event_character, shift_down, control_down, menu_down);
		}
	}
	return result;
}