Package org.fulib.fx.annotation.event
Annotation 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 ClassesModifier and TypeClassDescriptionstatic enumPossible targets for registering key events.static enumEnum representation for differentKeyEventtypes. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether the alt key has to be pressed (seestrict()).The character of the key event.javafx.scene.input.KeyCodeThe code of the key event.booleanWhether the control key has to be pressed (seestrict()).booleanWhether the meta key has to be pressed (seestrict()).booleanWhether the shift key has to be pressed (seestrict()).booleanWhether the settings for meta, control, alt and shift keys are strict.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 codeThe code of the key event.- Returns:
- The code of the key event
- Default:
- UNDEFINED
-
character
String characterThe character of the key event.- Returns:
- The character of the key event
- Default:
- "\u0000"
-
text
String textThe text of the key event.- Returns:
- The text of the key event
- Default:
- ""
-
shift
boolean shiftWhether the shift key has to be pressed (seestrict()).- Returns:
- Whether the shift key has to be pressed
- Default:
- false
-
control
boolean controlWhether the control key has to be pressed (seestrict()).- Returns:
- Whether the control key has to be pressed
- Default:
- false
-
alt
boolean altWhether the alt key has to be pressed (seestrict()).- Returns:
- Whether the alt key has to be pressed
- Default:
- false
-
meta
boolean metaWhether the meta key has to be pressed (seestrict()). 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
-
strict
boolean strictWhether the settings for meta, control, alt and shift keys are strict.- When strict mode is enabled, setting any of these options to false means the key must not be pressed.
- When strict mode is disabled, setting any of these options to false means the key does not need to be pressed.
- Returns:
- Whether the settings for meta, control, alt and shift keys are strict.
- Default:
- false
-
target
OnKey.Target targetThe 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
OnKey.Type typeThe type of the event.- Returns:
- The type of the event
- Default:
- PRESSED
-