Search in sources :

Example 6 with MouseButtonEvent

use of com.jme3.input.event.MouseButtonEvent in project jmonkeyengine by jMonkeyEngine.

the class AwtMouseInput method mouseReleased.

public void mouseReleased(MouseEvent awtEvt) {
    int y = component.getHeight() - awtEvt.getY();
    MouseButtonEvent evt = new MouseButtonEvent(getJMEButtonIndex(awtEvt), false, awtEvt.getX(), y);
    evt.setTime(awtEvt.getWhen());
    synchronized (eventQueue) {
        eventQueue.add(evt);
    }
}
Also used : MouseButtonEvent(com.jme3.input.event.MouseButtonEvent)

Example 7 with MouseButtonEvent

use of com.jme3.input.event.MouseButtonEvent in project jmonkeyengine by jMonkeyEngine.

the class NewtMouseInput method mouseReleased.

@Override
public void mouseReleased(MouseEvent awtEvt) {
    MouseButtonEvent evt = new MouseButtonEvent(getJMEButtonIndex(awtEvt), false, awtEvt.getX(), component.getSurfaceHeight() - awtEvt.getY());
    evt.setTime(awtEvt.getWhen());
    synchronized (eventQueue) {
        eventQueue.add(evt);
    }
}
Also used : MouseButtonEvent(com.jme3.input.event.MouseButtonEvent)

Example 8 with MouseButtonEvent

use of com.jme3.input.event.MouseButtonEvent in project jmonkeyengine by jMonkeyEngine.

the class GlfwMouseInput method onMouseButton.

private void onMouseButton(final long window, final int button, final int action, final int mods) {
    final MouseButtonEvent mouseButtonEvent = new MouseButtonEvent(convertButton(button), action == GLFW_PRESS, mouseX, mouseY);
    mouseButtonEvent.setTime(getInputTimeNanos());
    mouseButtonEvents.add(mouseButtonEvent);
}
Also used : MouseButtonEvent(com.jme3.input.event.MouseButtonEvent)

Example 9 with MouseButtonEvent

use of com.jme3.input.event.MouseButtonEvent in project jmonkeyengine by jMonkeyEngine.

the class GlfwMouseInputVR method onMouseButton.

private void onMouseButton(final long window, final int button, final int action, final int mods) {
    final MouseButtonEvent mouseButtonEvent = new MouseButtonEvent(convertButton(button), action == GLFW_PRESS, mouseX, mouseY);
    mouseButtonEvent.setTime(getInputTimeNanos());
    mouseButtonEvents.add(mouseButtonEvent);
}
Also used : MouseButtonEvent(com.jme3.input.event.MouseButtonEvent)

Aggregations

MouseButtonEvent (com.jme3.input.event.MouseButtonEvent)9 MouseMotionEvent (com.jme3.input.event.MouseMotionEvent)3 InputEvent (com.jme3.input.event.InputEvent)2 KeyInputEvent (com.jme3.input.event.KeyInputEvent)1