Interface InputDevice
- All Superinterfaces:
Updatable
Used to poll the status of the platform's input devices. This includes
keyboard, mouse, and touch controls, though the available input devices
depend on the platform and device. MultimediaLib applications are
frame-based, so input devices can be checked by polling.
-
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidfillClipboard(String text) Copies the specified text to the system clipboard.Returns all currently active pointers.booleanbooleanisKeyPressed(KeyCode keyCode) Returns true if the key with the specified key code was pressed during the current frame.booleanisKeyReleased(KeyCode keyCode) Returns true if the key with the specified key code was released during the current frame.default booleanisPointerPressed(Rect bounds) Convenience method that returns true if any of the pointer devices is currently pressed and located within the specified bounds.default booleanisPointerPressed(StageNode2D node) Convenience method that returns true if any of the pointers is currently pressed within the specified node's bounds (as described byStageNode2D.getStageBounds()).default booleanisPointerReleased(Rect bounds) Convenience method that returns true if any of the pointer devices has been released within the specified bounds.default booleanisPointerReleased(StageNode2D node) Convenience method that returns true if any of the pointers is currently released within the specified node's bounds (as described byStageNode2D.getStageBounds()).booleannl.colorize.util.EventQueue<String> requestTextInput(String label, String initialValue) Shows a dialog window with a text input field.
-
Method Details
-
getPointers
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.
-
isPointerPressed
Convenience method that returns true if any of the pointer devices is currently pressed and located within the specified bounds. -
isPointerPressed
Convenience method that returns true if any of the pointers is currently pressed within the specified node's bounds (as described byStageNode2D.getStageBounds()). -
isPointerReleased
Convenience method that returns true if any of the pointer devices has been released within the specified bounds. -
isPointerReleased
Convenience method that returns true if any of the pointers is currently released within the specified node's bounds (as described byStageNode2D.getStageBounds()). -
clearPointerState
Deprecated.Prefer usingPointer.clearState()on individual pointers over trying to globally manage all pointers using this method.Clears all pointer state for all currently active pointers. Using this method is the equivalent of usingPointer.clearState()on all pointers. -
isTouchAvailable
boolean isTouchAvailable() -
isKeyboardAvailable
boolean isKeyboardAvailable() -
isKeyPressed
Returns true if the key with the specified key code was pressed during the current frame. -
isKeyReleased
Returns true if the key with the specified key code was released during the current frame. -
requestTextInput
-
fillClipboard
Copies the specified text to the system clipboard.
-
Pointer.clearState()on individual pointers over trying to globally manage all pointers using this method.