Class Mouse
- java.lang.Object
-
- com.runemate.game.api.hybrid.input.Mouse
-
public final class Mouse extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Mouse.Button
static class
Mouse.CrosshairState
static class
Mouse.PathGenerator
-
Field Summary
Fields Modifier and Type Field Description static Mouse.PathGenerator
CLOUSE_PATH_GENERATOR
Deprecated.static double
DEFAULT_MOUSE_SPEED
static Mouse.PathGenerator
DEFAULT_PATH_GENERATOR
static Mouse.PathGenerator
HOPPING_PATH_GENERATOR
static Mouse.PathGenerator
MLP_PATH_GENERATOR
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
click(Interactable target, Mouse.Button button)
Moves the mouse over the target and presses the specified buttonstatic boolean
click(Mouse.Button button)
Presses a button and waits a calculated time before release.static boolean
click(Mouse.Button button, int delay)
Presses a button, and waits a specific amount of time before releasestatic boolean
drag(Interactable start, Interactable target)
static boolean
drag(Interactable start, Interactable target, Mouse.Button button)
static Mouse.CrosshairState
getCrosshairState()
static Mouse.CrosshairState
getOverlayCrosshairColorFor(Interactable target)
Checks if a recent click was likely successful based on target type and the current crosshair state.static Mouse.PathGenerator
getPathGenerator()
static java.awt.Point
getPosition()
The current position of the virtual mousestatic Interactable
getPreviousTarget()
static double
getSpeedMultiplier()
static Interactable
getTarget()
The target that the mouse is moving towardsstatic boolean
isInputAllowed()
static boolean
isMenuInteractionForced()
static boolean
isMoving()
static boolean
isPressed()
Gets whether or mouse button is pressedstatic boolean
isPressed(Mouse.Button button)
Gets whether the specified mouse button is pressedstatic boolean
move(Interactable target)
Moves the mouse over the interactable targetstatic boolean
press(Mouse.Button button)
static boolean
release(Mouse.Button button)
static void
scroll(boolean down)
Scrolls the mousestatic void
scroll(boolean down, int delay)
Rotates the mouse wheel and then delays for the specified amount of timestatic void
setForceMenuInteraction(boolean value)
static void
setPathGenerator(Mouse.PathGenerator generator)
static void
setSpeedMultiplier(double multiplier)
static void
toggleInput()
Deprecated.static boolean
wasClickSuccessful(Interactable target)
Deprecated.
-
-
-
Field Detail
-
HOPPING_PATH_GENERATOR
public static final Mouse.PathGenerator HOPPING_PATH_GENERATOR
-
CLOUSE_PATH_GENERATOR
@Deprecated public static final Mouse.PathGenerator CLOUSE_PATH_GENERATOR
Deprecated.
-
MLP_PATH_GENERATOR
public static final Mouse.PathGenerator MLP_PATH_GENERATOR
-
DEFAULT_PATH_GENERATOR
public static final Mouse.PathGenerator DEFAULT_PATH_GENERATOR
-
DEFAULT_MOUSE_SPEED
public static final double DEFAULT_MOUSE_SPEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
click
public static boolean click(Mouse.Button button)
Presses a button and waits a calculated time before release.
-
click
public static boolean click(Mouse.Button button, int delay)
Presses a button, and waits a specific amount of time before release
-
click
public static boolean click(Interactable target, Mouse.Button button)
Moves the mouse over the target and presses the specified button- Returns:
- true if the target acknowledges the click
-
drag
public static boolean drag(Interactable start, Interactable target)
-
drag
public static boolean drag(Interactable start, Interactable target, Mouse.Button button)
-
getCrosshairState
public static Mouse.CrosshairState getCrosshairState()
-
getPathGenerator
public static Mouse.PathGenerator getPathGenerator()
-
setPathGenerator
public static void setPathGenerator(Mouse.PathGenerator generator)
-
getPosition
public static java.awt.Point getPosition()
The current position of the virtual mouse
-
getSpeedMultiplier
public static double getSpeedMultiplier()
-
setSpeedMultiplier
public static void setSpeedMultiplier(double multiplier)
-
getTarget
public static Interactable getTarget()
The target that the mouse is moving towards
-
getPreviousTarget
public static Interactable getPreviousTarget()
-
isInputAllowed
public static boolean isInputAllowed()
-
isMenuInteractionForced
public static boolean isMenuInteractionForced()
-
isMoving
public static boolean isMoving()
-
isPressed
public static boolean isPressed(Mouse.Button button)
Gets whether the specified mouse button is pressed
-
isPressed
public static boolean isPressed()
Gets whether or mouse button is pressed
-
move
public static boolean move(Interactable target)
Moves the mouse over the interactable target- Returns:
- true if hovering the target
-
press
public static boolean press(Mouse.Button button)
-
release
public static boolean release(Mouse.Button button)
-
scroll
public static void scroll(boolean down)
Scrolls the mouse- Parameters:
down
- true to scroll the mouse down, otherwise up
-
scroll
public static void scroll(boolean down, int delay)
Rotates the mouse wheel and then delays for the specified amount of time
-
setForceMenuInteraction
public static void setForceMenuInteraction(boolean value)
-
toggleInput
@Deprecated public static void toggleInput()
Deprecated.DEPRECATED - toggling mouse and keyboard input is now exclusively controlled by the user, who can set a default value via user settings.
-
wasClickSuccessful
@Deprecated public static boolean wasClickSuccessful(Interactable target)
Deprecated.
-
getOverlayCrosshairColorFor
public static Mouse.CrosshairState getOverlayCrosshairColorFor(Interactable target)
Checks if a recent click was likely successful based on target type and the current crosshair state. This is used internally by the interaction engine and shouldn't be used elsewhere.
-
-