Annotation Interface OnKey


@Target(METHOD) @Retention(RUNTIME) public @interface OnKey
Methods annotated with this annotation will be called upon a key event. The key event can be specified by the parameters of this annotation.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
    static enum 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the alt key has to be pressed.
    The character of the key event.
    javafx.scene.input.KeyCode
    The code of the key event.
    boolean
    Whether the control key has to be pressed.
    boolean
    Whether the meta key has to be pressed.
    boolean
    Whether the shift key has to be pressed.
    The target at which the event should be handled.
    The text of the key event.
    The type of the event.
  • Element Details

    • code

      javafx.scene.input.KeyCode code
      The code of the key event.
      Returns:
      The code of the key event
      Default:
      UNDEFINED
    • character

      String character
      The character of the key event.
      Returns:
      The character of the key event
      Default:
      "\u0000"
    • text

      String text
      The text of the key event.
      Returns:
      The text of the key event
      Default:
      ""
    • shift

      boolean shift
      Whether the shift key has to be pressed.
      Returns:
      Whether the shift key has to be pressed
      Default:
      false
    • control

      boolean control
      Whether the control key has to be pressed.
      Returns:
      Whether the control key has to be pressed
      Default:
      false
    • alt

      boolean alt
      Whether the alt key has to be pressed.
      Returns:
      Whether the alt key has to be pressed
      Default:
      false
    • meta

      boolean meta
      Whether the meta key has to be pressed. The meta key is the command key on Mac and the control key on other platforms.
      Returns:
      Whether the meta key has to be pressed
      Default:
      false
    • target

      OnKey.Target target
      The target at which the event should be handled.

      STAGE: The event will be handled by the stage

      SCENE: The event will be handled by the scene

      Returns:
      The target at which the event should be handled
      Default:
      STAGE
    • type

      The type of the event.
      Returns:
      The type of the event
      Default:
      PRESSED