use of org.terasology.input.ButtonState in project Terasology by MovingBlocks.
the class LwjglMouseDevice method mouseButtonCallback.
private void mouseButtonCallback(long window, int button, int action, int mods) {
ButtonState state;
if (action == GLFW.GLFW_PRESS) {
state = ButtonState.DOWN;
buttonStates.add(button);
} else if (action == GLFW.GLFW_RELEASE) {
state = ButtonState.UP;
buttonStates.remove(button);
} else /*if (action == GLFW.GLFW_REPEAT)*/
{
state = ButtonState.REPEAT;
}
MouseInput mouseInput = MouseInput.find(InputType.MOUSE_BUTTON, button);
queue.offer(new MouseAction(mouseInput, state, getPosition()));
}
Aggregations