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 screen
    static java.util.Set<javafx.scene.input.MouseButton> getPressedButtons()
    Get a Set of all buttons pressed as MouseButtons
    static float getWheelRotation()
    Get the rotation of the scroll wheel with speed and direction
    static void init​(javafx.scene.canvas.Canvas canvas)
    Add the event listeners to the main Canvas of the program
    static boolean isPressed​(javafx.scene.input.MouseButton... button)
    Check if MouseButtons are pressed

    Methods 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

      public static Vector 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