Class KeyDefinition

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getKey() The value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the keyboard locale and layout.
      final Integer getKeyCode() Represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
      final Integer getKeyCodeWithoutLocation() The key code without location, like 13, 65, 51, ...
      final String getShiftKey() The key name of the shifted key, like "KeyA", "KeyB", ...
      final Integer getShiftKeyCode() The key code of the shifted key, like 65, 66, ...
      final String getText() Returns the value of the key pressed by the user.
      final Integer getLocation() Returns an int representing the location of the key on the keyboard.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getKey

         final String getKey()

        The value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the keyboard locale and layout.

        Examples: "a", "b", "A", "B", "1", "2", "3", "Shift", "Enter", ...

      • getKeyCode

         final Integer getKeyCode()

        Represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.

        Note: The key code is a numeric value that represents a physical key on the keyboard. It's not the character.

        Key code examples: 13, 65, 51, ...

        You should avoid using this if possible; it's been deprecated for some time. Instead, you should use code if available. Codes are more reliable than key codes, because they are not affected by layout. Code example: "KeyA", "Digit3", "Enter", ...

      • getShiftKey

         final String getShiftKey()

        The key name of the shifted key, like "KeyA", "KeyB", ...

      • getText

         final String getText()

        Returns the value of the key pressed by the user.

        Example values: "Enter", "a", "3", ...

      • getLocation

         final Integer getLocation()

        Returns an int representing the location of the key on the keyboard. Example values: 0, 1, 2, 3, ...