Interface KeyPressed

All Superinterfaces:
KeyEvent

public interface KeyPressed extends KeyEvent
An event indicating that a keyboard key has been pressed.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder of KeyPressed.
  • Method Summary

    Modifier and Type
    Method
    Description
    default char
    Returns the character corresponding to the pressed key or 0 when a keyboard modifier such as Shift, Ctrl, Alt, Command, Win etc.
    default KeyCode
    Returns the code of the key.
    default KeyLocation
    Returns the location of the key on the keyboard.
    default KeyModifiers
    Returns the keyboard modifiers applied.
    Creates a new KeyPressed builder with the given required parameters.
  • Method Details

    • newBuilder

      static KeyPressed.Builder newBuilder(KeyCode keyCode)
      Creates a new KeyPressed builder with the given required parameters.
      Parameters:
      keyCode - the code of the key
      Returns:
      a new KeyPressed.Builder instance
    • keyCode

      default KeyCode keyCode()
      Description copied from interface: KeyEvent
      Returns the code of the key.
      Specified by:
      keyCode in interface KeyEvent
    • keyModifiers

      default KeyModifiers keyModifiers()
      Description copied from interface: KeyEvent
      Returns the keyboard modifiers applied.
      Specified by:
      keyModifiers in interface KeyEvent
    • keyLocation

      default KeyLocation keyLocation()
      Description copied from interface: KeyEvent
      Returns the location of the key on the keyboard.
      Specified by:
      keyLocation in interface KeyEvent
    • keyChar

      default char keyChar()
      Returns the character corresponding to the pressed key or 0 when a keyboard modifier such as Shift, Ctrl, Alt, Command, Win etc. has been pressed on its own.