Class Keyboard

java.lang.Object
xyz.jeremynoesen.pseudo3d.input.Keyboard

public class Keyboard
extends java.lang.Object
Class to listen for key strokes, allowing multiple key presses
  • Constructor Summary

    Constructors
    Constructor Description
    Keyboard()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.Set<javafx.scene.input.KeyCode> getPressedKeys()
    Get a Set of all keys currently pressed by their key codes
    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.KeyCode... key)
    Check if keys are pressed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Keyboard

      public Keyboard()
  • Method Details

    • isPressed

      public static boolean isPressed​(javafx.scene.input.KeyCode... key)
      Check if keys are pressed
      Parameters:
      key - KeyCodes to check if pressed
      Returns:
      True if the keys are pressed
    • getPressedKeys

      public static java.util.Set<javafx.scene.input.KeyCode> getPressedKeys()
      Get a Set of all keys currently pressed by their key codes
      Returns:
      Set of KeyCodes currently pressed
    • 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