Package xyz.jeremynoesen.pseudo3d.input
Class Mouse
java.lang.Object
xyz.jeremynoesen.pseudo3d.input.Mouse
public class Mouse
extends java.lang.Object
Class to keep track of mouse clicks and movement
-
Constructor Summary
Constructors Constructor Description Mouse()
-
Method Summary
Modifier and Type Method Description static Vector
getPosition()
Get the absolute position of the pointer on the screenstatic java.util.Set<javafx.scene.input.MouseButton>
getPressedButtons()
Get a Set of all buttons pressed as MouseButtonsstatic float
getWheelRotation()
Get the rotation of the scroll wheel with speed and directionstatic void
init(javafx.scene.canvas.Canvas canvas)
Add the event listeners to the main Canvas of the programstatic boolean
isPressed(javafx.scene.input.MouseButton... button)
Check if MouseButtons are pressedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Mouse
public Mouse()
-
-
Method Details
-
isPressed
public static boolean isPressed(javafx.scene.input.MouseButton... button)Check if MouseButtons are pressed- Parameters:
button
- MouseButtons to check if pressed- Returns:
- True if the MouseButtons are pressed
-
getPressedButtons
public static java.util.Set<javafx.scene.input.MouseButton> getPressedButtons()Get a Set of all buttons pressed as MouseButtons- Returns:
- Set of MouseButtons pressed
-
getWheelRotation
public static float getWheelRotation()Get the rotation of the scroll wheel with speed and direction- Returns:
- Rotation of the scroll wheel
-
getPosition
Get the absolute position of the pointer on the screen- Returns:
- Absolute position of pointer on the screen
-
init
public static void init(javafx.scene.canvas.Canvas canvas)Add the event listeners to the main Canvas of the program- Parameters:
canvas
- Main Canvas of the program
-