Package jltk

Class Keyboard


  • public class Keyboard
    extends Object
    Beschreiben Sie hier die Klasse Keyboard.
    Version:
    (eine Versionsnummer oder ein Datum)
    Author:
    (Ihr Name)
    • Constructor Summary

      Constructors 
      Constructor Description
      Keyboard()  
    • Constructor Detail

      • Keyboard

        public Keyboard()
    • Method Detail

      • isKeyDown

        public static boolean isKeyDown​(String key)
        Check whether a key, identified by a key name (String), is currently down .
        Parameters:
        key - The name of the key to check
        Returns:
        True if the key is currently down, or was down since it was last checked; false otherwise.
      • getKey

        public static String getKey()
        Get the last key pressed, as a String key name identifying the key.
      • keyPressed

        protected static String keyPressed​(javafx.scene.input.KeyCode keyCode)
        Notifies that a key has been pressed. (For internal use)
        Parameters:
        keyCode - The KeyCode from KeyEvent.getCode()
      • keyReleased

        protected static String keyReleased​(javafx.scene.input.KeyCode keyCode)
        Notifies that a key has been released. (For internal use)
        Parameters:
        keyCode - The KeyCode from KeyEvent.getCode()
      • getKeyName

        protected static String getKeyName​(javafx.scene.input.KeyCode keycode)
        Translate the "key pad" directional keys according to the status of numlock, and otherwise translate a KeyCode+text into a the key name.
        Parameters:
        keycode - The original keycode
        keyText - The text from the original keyboard event
        Returns:
        The translated key name