| Modifier and Type | Field and Description |
|---|---|
| private static int | absolute_x
Mouse absolute X position in pixels without any clipping |
| private static int | absolute_y
Mouse absolute Y position in pixels without any clipping |
| private static final int | BUFFER_SIZE
Buffer size in events |
| private static int | buttonCount
Number of buttons supported by the mouse |
| private static final Map | buttonMap
hashmap of button names, for fast lookup |
| private static String[] | buttonName
Button names. |
| private static ByteBuffer | buttons
The mouse buttons status from the last poll |
| private static boolean | |
| private static IntBuffer | coord_buffer
Buffer to hold the deltas dx, dy and dwheel |
| private static boolean | created
Has the mouse been created? |
| private static Cursor | currentCursor
The current native cursor, if any |
| private static int | dwheel
Delta Z |
| private static int | dx
Delta X |
| private static int | dy
Delta Y |
| private static final boolean | emulateCursorAnimation
Whether we need cursor animation emulation |
| private static int | |
| private static int | event_dx
The current delta of the mouse in the event queue |
| private static int | |
| private static long | |
| public static final int | EVENT_SIZE
Internal use - event size in bytes |
| private static int | event_x
The current absolute position of the mouse in the event queue |
| private static int | |
| private static int | eventButton
The current mouse event button being examined |
| private static boolean | eventState
The current state of the button being examined in the event queue |
| private static int | grab_x
The position of the mouse it was grabbed at |
| private static int | |
| private static boolean | hasWheel
Does this mouse support a scroll wheel |
| private static InputImplementation | |
| private static boolean | initialized
Lazy initialization |
| private static boolean | |
| private static int | last_event_raw_x
The last absolute mouse event position (before clipping) for delta computation |
| private static int | |
| private static ByteBuffer | readBuffer
The mouse button events from the last read |
| private static int | x
Mouse absolute X position in pixels |
| private static int | y
Mouse absolute Y position in pixels |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static void | |
| public static void | |
| public static int | |
| public static int | |
| public static String | Returns: a String with the button's human readable name in it or null if the button is unnamedThe button button)Gets a button's name |
| public static int | |
| public static int | |
| public static int | |
| public static int | |
| public static boolean | |
| public static int | |
| public static int | |
| public static int | |
| public static long | Returns: The time in nanoseconds of the current eventGets the time in nanoseconds of the current event. |
| public static int | |
| public static int | |
| pack-priv static InputImplementation | |
| public static Cursor | Returns: the currently bound native cursor, if any.Gets the currently bound native cursor, if any. |
| pack-priv static boolean | |
| public static int | |
| public static int | |
| public static boolean | |
| private static void | |
| public static boolean | Returns: true if the specified button is downThe index of the button you wish to test (0..getButtonCount-1) button)See if a particular mouse button is down. |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | Returns: true if mouse is inside display, false otherwise.Retrieves whether or not the mouse cursor is within the bounds of the window. |
| public static boolean | |
| public static void | |
| private static void | |
| private static void | |
| public static void | |
| public static void | setCursorPosition(int
The x coordinate of the new cursor position in OpenGL coordinates relative
to the window origin. new_x, int The y coordinate of the new cursor position in OpenGL coordinates relative
to the window origin. new_y)Set the position of the cursor. |
| public static void | setGrabbed(boolean
whether the mouse should be grabbed grab)Sets whether or not the mouse has grabbed the cursor (and thus hidden). |
| public static Cursor | Returns: The previous Cursor object set, or null.the native cursor object to bind. May be null. cursor)Binds a native cursor. |
| public static void |
| absolute_x | back to summary |
|---|---|
| private static int absolute_x Mouse absolute X position in pixels without any clipping | |
| absolute_y | back to summary |
|---|---|
| private static int absolute_y Mouse absolute Y position in pixels without any clipping | |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE Buffer size in events | |
| buttonCount | back to summary |
|---|---|
| private static int buttonCount Number of buttons supported by the mouse | |
| buttonMap | back to summary |
|---|---|
| private static final Map<String, Integer> buttonMap hashmap of button names, for fast lookup | |
| buttonName | back to summary |
|---|---|
| private static String[] buttonName Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. | |
| buttons | back to summary |
|---|---|
| private static ByteBuffer buttons The mouse buttons status from the last poll | |
| clipMouseCoordinatesToWindow | back to summary |
|---|---|
| private static boolean clipMouseCoordinatesToWindow | |
| coord_buffer | back to summary |
|---|---|
| private static IntBuffer coord_buffer Buffer to hold the deltas dx, dy and dwheel | |
| created | back to summary |
|---|---|
| private static boolean created Has the mouse been created? | |
| currentCursor | back to summary |
|---|---|
| private static Cursor currentCursor The current native cursor, if any | |
| dwheel | back to summary |
|---|---|
| private static int dwheel Delta Z | |
| dx | back to summary |
|---|---|
| private static int dx Delta X | |
| dy | back to summary |
|---|---|
| private static int dy Delta Y | |
| emulateCursorAnimation | back to summary |
|---|---|
| private static final boolean emulateCursorAnimation Whether we need cursor animation emulation | |
| event_dwheel | back to summary |
|---|---|
| private static int event_dwheel | |
| event_dx | back to summary |
|---|---|
| private static int event_dx The current delta of the mouse in the event queue | |
| event_dy | back to summary |
|---|---|
| private static int event_dy | |
| event_nanos | back to summary |
|---|---|
| private static long event_nanos | |
| EVENT_SIZE | back to summary |
|---|---|
| public static final int EVENT_SIZE Internal use - event size in bytes | |
| event_x | back to summary |
|---|---|
| private static int event_x The current absolute position of the mouse in the event queue | |
| event_y | back to summary |
|---|---|
| private static int event_y | |
| eventButton | back to summary |
|---|---|
| private static int eventButton The current mouse event button being examined | |
| eventState | back to summary |
|---|---|
| private static boolean eventState The current state of the button being examined in the event queue | |
| grab_x | back to summary |
|---|---|
| private static int grab_x The position of the mouse it was grabbed at | |
| grab_y | back to summary |
|---|---|
| private static int grab_y | |
| hasWheel | back to summary |
|---|---|
| private static boolean hasWheel Does this mouse support a scroll wheel | |
| implementation | back to summary |
|---|---|
| private static InputImplementation implementation | |
| initialized | back to summary |
|---|---|
| private static boolean initialized Lazy initialization | |
| isGrabbed | back to summary |
|---|---|
| private static boolean isGrabbed | |
| last_event_raw_x | back to summary |
|---|---|
| private static int last_event_raw_x The last absolute mouse event position (before clipping) for delta computation | |
| last_event_raw_y | back to summary |
|---|---|
| private static int last_event_raw_y | |
| readBuffer | back to summary |
|---|---|
| private static ByteBuffer readBuffer The mouse button events from the last read | |
| x | back to summary |
|---|---|
| private static int x Mouse absolute X position in pixels | |
| y | back to summary |
|---|---|
| private static int y Mouse absolute Y position in pixels | |
| Mouse | back to summary |
|---|---|
| private Mouse() Mouse cannot be constructed. | |
| create | back to summary |
|---|---|
| private static void create(InputImplementation impl) throws LWJGLException "Create" the mouse with the given custom implementation. This is used reflectively by AWTInputAdapter.
| |
| create | back to summary |
|---|---|
| public static void create() throws LWJGLException "Create" the mouse. The display must first have been created. Initially, the mouse is not grabbed and the delta values are reported with respect to the center of the display.
| |
| destroy | back to summary |
|---|---|
| public static void destroy() "Destroy" the mouse. | |
| getButtonCount | back to summary |
|---|---|
public static int getButtonCount()
| |
| getButtonIndex | back to summary |
|---|---|
| public static int getButtonIndex(String buttonName) Get's a button's index. If the button is unrecognised then -1 is returned.
| |
| getButtonName | back to summary |
|---|---|
| public static String getButtonName(int button) Gets a button's name
| |
| getDWheel | back to summary |
|---|---|
public static int getDWheel()
| |
| getDX | back to summary |
|---|---|
public static int getDX()
| |
| getDY | back to summary |
|---|---|
public static int getDY()
| |
| getEventButton | back to summary |
|---|---|
public static int getEventButton()
| |
| getEventButtonState | back to summary |
|---|---|
| public static boolean getEventButtonState() Get the current events button state.
| |
| getEventDWheel | back to summary |
|---|---|
public static int getEventDWheel()
| |
| getEventDX | back to summary |
|---|---|
public static int getEventDX()
| |
| getEventDY | back to summary |
|---|---|
public static int getEventDY()
| |
| getEventNanoseconds | back to summary |
|---|---|
| public static long getEventNanoseconds() Gets the time in nanoseconds of the current event. Only useful for relative comparisons with other Mouse events, as the absolute time has no defined origin.
| |
| getEventX | back to summary |
|---|---|
public static int getEventX()
| |
| getEventY | back to summary |
|---|---|
public static int getEventY()
| |
| getImplementation | back to summary |
|---|---|
| pack-priv static InputImplementation getImplementation() | |
| getNativeCursor | back to summary |
|---|---|
| public static Cursor getNativeCursor() Gets the currently bound native cursor, if any.
| |
| getPrivilegedBoolean | back to summary |
|---|---|
| pack-priv static boolean getPrivilegedBoolean(final String property_name) Gets a boolean property as a privileged action. | |
| getX | back to summary |
|---|---|
| public static int getX() Retrieves the absolute position. It will be clamped to 0...width-1.
| |
| getY | back to summary |
|---|---|
| public static int getY() Retrieves the absolute position. It will be clamped to 0...height-1.
| |
| hasWheel | back to summary |
|---|---|
public static boolean hasWheel()
| |
| initialize | back to summary |
|---|---|
| private static void initialize() Static initialization | |
| isButtonDown | back to summary |
|---|---|
| public static boolean isButtonDown(int button) See if a particular mouse button is down.
| |
| isClipMouseCoordinatesToWindow | back to summary |
|---|---|
| public static boolean isClipMouseCoordinatesToWindow() | |
| isCreated | back to summary |
|---|---|
public static boolean isCreated()
| |
| isGrabbed | back to summary |
|---|---|
public static boolean isGrabbed()
| |
| isInsideWindow | back to summary |
|---|---|
| public static boolean isInsideWindow() Retrieves whether or not the mouse cursor is within the bounds of the window. If the mouse cursor was moved outside the display during a drag, then the result of calling this method will be true until the button is released.
| |
| next | back to summary |
|---|---|
| public static boolean next() Gets the next mouse event. You can query which button caused the event by using
| |
| poll | back to summary |
|---|---|
| public static void poll() Polls the mouse for its current state. Access the polled values using the
get Note
This method does not query the operating system for new events. To do that,
Display.processMessages() (or Display.update()) must be called first.
| |
| read | back to summary |
|---|---|
| private static void read() | |
| resetMouse | back to summary |
|---|---|
| private static void resetMouse() | |
| setClipMouseCoordinatesToWindow | back to summary |
|---|---|
| public static void setClipMouseCoordinatesToWindow(boolean clip) | |
| setCursorPosition | back to summary |
|---|---|
| public static void setCursorPosition(int new_x, int new_y) Set the position of the cursor. If the cursor is not grabbed, the native cursor is moved to the new position.
| |
| setGrabbed | back to summary |
|---|---|
| public static void setGrabbed(boolean grab) Sets whether or not the mouse has grabbed the cursor (and thus hidden). If grab is false, the getX() and getY() will return delta movement in pixels clamped to the display dimensions, from the center of the display.
| |
| setNativeCursor | back to summary |
|---|---|
| public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException Binds a native cursor. If the cursor argument is null, any currently bound native cursor is disabled, and the cursor reverts to the default operating system supplied cursor. Note The native cursor is not constrained to the window, but relative events will not be generated if the cursor is outside.
| |
| updateCursor | back to summary |
|---|---|
| public static void updateCursor() Updates the cursor, so that animation can be changed if needed. This method is called automatically by the window on its update, and shouldn't be called otherwise | |