public final class Mouse extends Object
Window.pollEvents()
method instead.Modifier and Type | Class and Description |
---|---|
static class |
Mouse.Button
Enumeration of supported mouse buttons.
|
Modifier and Type | Method and Description |
---|---|
static Vector2i |
getPosition()
Retrieves the absolute position of the mouse cursor on the screen.
|
static Vector2i |
getPosition(Window relativeTo)
Retrieves the position of the mouse cursor relative to a window.
|
static boolean |
isButtonPressed(Mouse.Button button)
Checks if a mouse button is currently pressed.
|
static void |
setPosition(Vector2i position)
Sets the absolute position of the mouse cursor on the screen.
|
static void |
setPosition(Vector2i position,
Window relativeTo)
Sets the position of the mouse cursor relative to a window.
|
public static boolean isButtonPressed(Mouse.Button button)
button
- the mouse button in question.true
if the button is currently being pressed,
false
otherwise.public static Vector2i getPosition()
public static Vector2i getPosition(Window relativeTo)
relativeTo
- the window in question.public static void setPosition(Vector2i position)
position
- the new absolute position of the mouse cursor on the screen.