Class JFXInput
java.lang.Object
nl.colorize.multimedialib.renderer.jfx.JFXInput
- All Implemented Interfaces:
InputDevice
,Updatable
Captures the current state for mouse and keyboard events, updated using
JavaFX event handlers.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all pointer state for all currently active pointers.void
fillClipboard
(String text) Copies the specified text to the system clipboard.Returns all currently active pointers.boolean
boolean
isKeyPressed
(KeyCode keyCode) Returns true if the key with the specified key code was pressed during the current frame.boolean
isKeyReleased
(KeyCode keyCode) Returns true if the key with the specified key code was released during the current frame.boolean
requestTextInput
(String labelText, String initialValue) Shows a dialog window requesting the user to enter text.void
update
(float deltaTime) Updates this object for the current frame.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nl.colorize.multimedialib.renderer.InputDevice
isPointerPressed, isPointerReleased
-
Field Details
-
mouseEventQueue
-
keyEventQueue
-
-
Constructor Details
-
JFXInput
-
-
Method Details
-
update
public void update(float deltaTime) Description copied from interface:Updatable
Updates this object for the current frame.deltaTime
indicates the elapsed time since the last frame update, in seconds. -
getPointers
Description copied from interface:InputDevice
Returns all currently active pointers. Depending on the current platform and device, pointers could be based on mouse input, a trackpad, or touch controls.Note that the type of pointer will also influence its behavior. The mouse pointer is always included in this list, since the mouse cursor is always visible. Touch pointer are only available during the touch, as the pointer disappears once the touch event has ended.
- Specified by:
getPointers
in interfaceInputDevice
-
clearPointerState
public void clearPointerState()Description copied from interface:InputDevice
Clears all pointer state for all currently active pointers.- Specified by:
clearPointerState
in interfaceInputDevice
-
isTouchAvailable
public boolean isTouchAvailable()- Specified by:
isTouchAvailable
in interfaceInputDevice
-
isKeyboardAvailable
public boolean isKeyboardAvailable()- Specified by:
isKeyboardAvailable
in interfaceInputDevice
-
isKeyPressed
Description copied from interface:InputDevice
Returns true if the key with the specified key code was pressed during the current frame.- Specified by:
isKeyPressed
in interfaceInputDevice
-
isKeyReleased
Description copied from interface:InputDevice
Returns true if the key with the specified key code was released during the current frame.- Specified by:
isKeyReleased
in interfaceInputDevice
-
requestTextInput
Description copied from interface:InputDevice
Shows a dialog window requesting the user to enter text. This method exists only because text fields, unlike other input elements such as buttons, cannot be emulated by the renderer without losing common functionality such as copy/paste. Text input must therefore be delegated to the platform so that a native text field can be used.- Specified by:
requestTextInput
in interfaceInputDevice
-
fillClipboard
Description copied from interface:InputDevice
Copies the specified text to the system clipboard.- Specified by:
fillClipboard
in interfaceInputDevice
-