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 booleanisPointerReleased(Rect bounds) Convenience method that returns true if any of the pointer devices has been released within the specified bounds.booleannl.colorize.util.Subject<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. -
isPointerReleased
Convenience method that returns true if any of the pointer devices has been released within the specified bounds. -
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
Shows a dialog window with a text input field. The dialog window is not part of the scene, it uses the platform's native user interface. -
fillClipboard
Copies the specified text to the system clipboard.
-
Pointer.clearState()on individual pointers over trying to globally manage all pointers using this method.