Package com.luciad.input
Class KeyEvent
java.lang.Object
com.luciad.input.KeyEvent
- All Implemented Interfaces:
IInputEvent
,AutoCloseable
Implementation of
IInputEvent
that represents keyboard input.
This class contains the button state, the key and the modifiers if any.
-
Constructor Summary
ConstructorDescriptionKeyEvent
(ButtonState state, KeyCode key, ModifierKeys modifierKeys) Creates a key event.KeyEvent
(ButtonState state, KeyCode key, ModifierKeys modifierKeys, Coordinate lastKnownLocation) Creates a key event. -
Method Summary
-
Constructor Details
-
KeyEvent
public KeyEvent(@NotNull ButtonState state, @NotNull KeyCode key, @NotNull ModifierKeys modifierKeys) Creates a key event.- Parameters:
state
- The state of the key.key
- The key of the event.modifierKeys
- The modifiers of the event.
-
KeyEvent
public KeyEvent(@NotNull ButtonState state, @NotNull KeyCode key, @NotNull ModifierKeys modifierKeys, @NotNull Coordinate lastKnownLocation) Creates a key event.- Parameters:
state
- The state of the key.key
- The key of the event.modifierKeys
- The modifiers of the event.lastKnownLocation
- The last known location of the mouse
-
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getState
Returns the state of the key.- Returns:
- the state of the key.
-
getKey
Returns the key of the event.- Returns:
- the key of the event.
-
getModifierKeys
Returns the modifiers of the event.- Returns:
- the modifiers of the event.
-
getLastKnownLocation
Returns the last know location of the input device (for example the mouse cursor) when this event occurred.It is expressed in screen coordinates (px) with top-left corner of the map being the (0,0) position.
- Returns:
- the last know location of the input device when this event occurred.
-