Top Fields Constructors Methods
org.lwjgl.opengl

pack-priv Class MouseEventQueue

extends EventQueue
implements MouseListener, MouseMotionListener, MouseWheelListener
Class Inheritance
All Implemented Interfaces
java.awt.event.MouseWheelListener, java.util.EventListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener
Known Direct Subclasses
org.lwjgl.opengl.MacOSXMouseEventQueue
Imports
java.awt.Component, .Point, java.awt.event.MouseEvent, .MouseListener, .MouseMotionListener, .MouseWheelEvent, .MouseWheelListener, java.nio.ByteBuffer, .IntBuffer, org.lwjgl.input.Mouse

Field Summary

Modifier and TypeField and Description
private int
accum_dx

The accumulated mouse deltas returned by poll()

private int
private int
private final byte[]
buttons

Buttons array

private final Component
private final ByteBuffer
event

Event scratch array

private boolean
private int
last_x

The last mouse position

private int
public static final int
private boolean
saved_control_state

Saved control key state for ctrl-click right button emulation

private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
addDelta(int dx, int dy)

protected Component
private void
private void
private void
handleWheel(int amount, long nanos)

public synchronized boolean
public void
mouseClicked(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.
public synchronized void
mouseDragged(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.
public void
mouseEntered(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.
public void
mouseExited(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.
public synchronized void
mouseMoved(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
public synchronized void
mousePressed(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.
public synchronized void
mouseReleased(MouseEvent
the event to be processed
e
)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.
public synchronized void
mouseWheelMoved(MouseWheelEvent
the event to be processed
e
)

Implements java.awt.event.MouseWheelListener.mouseWheelMoved.

Invoked when the mouse wheel is rotated.
public synchronized void
poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer)

private void
putMouseEvent(byte button, byte state, int dz, long nanos)

protected void
putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos)

public synchronized void
protected void
private void
setButton(byte button, byte state, long nanos)

private void
setCursorPos(int x, int y, long nanos)

public synchronized void
setGrabbed(boolean grabbed)

protected int
transformY(int y)

public synchronized void
protected void
updateDeltas(long nanos)

Inherited from org.lwjgl.opengl.EventQueue:
clearEventscopyEventsputEvent

Field Detail

accum_dxback to summary
private int accum_dx

The accumulated mouse deltas returned by poll()

accum_dyback to summary
private int accum_dy
accum_dzback to summary
private int accum_dz
buttonsback to summary
private final byte[] buttons

Buttons array

componentback to summary
private final Component component
eventback to summary
private final ByteBuffer event

Event scratch array

grabbedback to summary
private boolean grabbed
last_xback to summary
private int last_x

The last mouse position

last_yback to summary
private int last_y
NUM_BUTTONSback to summary
public static final int NUM_BUTTONS
saved_control_stateback to summary
private boolean saved_control_state

Saved control key state for ctrl-click right button emulation

WHEEL_SCALEback to summary
private static final int WHEEL_SCALE

Constructor Detail

MouseEventQueueback to summary
pack-priv MouseEventQueue(Component component)

Method Detail

addDeltaback to summary
protected void addDelta(int dx, int dy)
getComponentback to summary
protected Component getComponent()
handleButtonback to summary
private void handleButton(MouseEvent e)
handleMotionback to summary
private void handleMotion(MouseEvent e)
handleWheelback to summary
private void handleWheel(int amount, long nanos)
isGrabbedback to summary
public synchronized boolean isGrabbed()
mouseClickedback to summary
public void mouseClicked(MouseEvent e)

Implements java.awt.event.MouseListener.mouseClicked.

Doc from java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

Parameters
e:MouseEvent

the event to be processed

mouseDraggedback to summary
public synchronized void mouseDragged(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Doc from java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Parameters
e:MouseEvent

the event to be processed

mouseEnteredback to summary
public void mouseEntered(MouseEvent e)

Implements java.awt.event.MouseListener.mouseEntered.

Doc from java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

Parameters
e:MouseEvent

the event to be processed

mouseExitedback to summary
public void mouseExited(MouseEvent e)

Implements java.awt.event.MouseListener.mouseExited.

Doc from java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

Parameters
e:MouseEvent

the event to be processed

mouseMovedback to summary
public synchronized void mouseMoved(MouseEvent e)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Doc from java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Parameters
e:MouseEvent

the event to be processed

mousePressedback to summary
public synchronized void mousePressed(MouseEvent e)

Implements java.awt.event.MouseListener.mousePressed.

Doc from java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

Parameters
e:MouseEvent

the event to be processed

mouseReleasedback to summary
public synchronized void mouseReleased(MouseEvent e)

Implements java.awt.event.MouseListener.mouseReleased.

Doc from java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

Parameters
e:MouseEvent

the event to be processed

mouseWheelMovedback to summary
public synchronized void mouseWheelMoved(MouseWheelEvent e)

Implements java.awt.event.MouseWheelListener.mouseWheelMoved.

Doc from java.awt.event.MouseWheelListener.mouseWheelMoved.

Invoked when the mouse wheel is rotated.

Parameters
e:MouseWheelEvent

the event to be processed

pollback to summary
public synchronized void poll(IntBuffer coord_buffer, ByteBuffer buttons_buffer)
putMouseEventback to summary
private void putMouseEvent(byte button, byte state, int dz, long nanos)
putMouseEventWithCoordsback to summary
protected void putMouseEventWithCoords(byte button, byte state, int coord1, int coord2, int dz, long nanos)
registerback to summary
public synchronized void register()
resetCursorToCenterback to summary
protected void resetCursorToCenter()
setButtonback to summary
private void setButton(byte button, byte state, long nanos)
setCursorPosback to summary
private void setCursorPos(int x, int y, long nanos)
setGrabbedback to summary
public synchronized void setGrabbed(boolean grabbed)
transformYback to summary
protected int transformY(int y)
unregisterback to summary
public synchronized void unregister()
updateDeltasback to summary
protected void updateDeltas(long nanos)