use of org.terasology.input.MouseInput in project Terasology by MovingBlocks.
the class UIInputBind method onMouseWheelEvent.
@Override
public void onMouseWheelEvent(NUIMouseWheelEvent event) {
if (capturingInput) {
MouseInput mouseInput = MouseInput.find(InputType.MOUSE_WHEEL, event.getWheelTurns());
setNewInput(InputType.MOUSE_WHEEL.getInput(mouseInput.getId()));
capturingInput = false;
event.consume();
}
}
use of org.terasology.input.MouseInput in project Terasology by MovingBlocks.
the class UIInputBind method onMouseWheelEvent.
@Override
public void onMouseWheelEvent(MouseWheelEvent event) {
if (capturingInput) {
MouseInput mouseInput = MouseInput.find(InputType.MOUSE_WHEEL, event.getWheelTurns());
setNewInput(InputType.MOUSE_WHEEL.getInput(mouseInput.getId()));
capturingInput = false;
event.consume();
}
}
use of org.terasology.input.MouseInput in project Terasology by MovingBlocks.
the class BindsSubsystem method linkBindButtonToInput.
private void linkBindButtonToInput(Input input, SimpleUri bindId) {
switch(input.getType()) {
case KEY:
linkBindButtonToKey(input.getId(), bindId);
break;
case MOUSE_BUTTON:
MouseInput button = MouseInput.find(input.getType(), input.getId());
linkBindButtonToMouse(button, bindId);
break;
case MOUSE_WHEEL:
linkBindButtonToMouseWheel(input.getId(), bindId);
break;
case CONTROLLER_BUTTON:
linkBindButtonToController((ControllerInput) input, bindId);
break;
default:
break;
}
}
use of org.terasology.input.MouseInput in project Terasology by MovingBlocks.
the class BindsSubsystem method linkBindButtonToInput.
private void linkBindButtonToInput(Input input, SimpleUri bindId) {
switch(input.getType()) {
case KEY:
linkBindButtonToKey(input.getId(), bindId);
break;
case MOUSE_BUTTON:
MouseInput button = MouseInput.find(input.getType(), input.getId());
linkBindButtonToMouse(button, bindId);
break;
case MOUSE_WHEEL:
linkBindButtonToMouseWheel(input.getId(), bindId);
break;
case CONTROLLER_BUTTON:
linkBindButtonToController((ControllerInput) input, bindId);
break;
default:
break;
}
}
use of org.terasology.input.MouseInput 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