Interface InputDevice

All Superinterfaces:
Updatable

public interface InputDevice extends 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 Details

    • getPointers

      Iterable<Pointer> 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

      default boolean isPointerPressed(Rect bounds)
      Convenience method that returns true if any of the pointer devices is currently pressed and located within the specified bounds.
    • isPointerPressed

      default boolean isPointerPressed(StageNode2D node)
      Convenience method that returns true if any of the pointers is currently pressed within the specified node's bounds (as described by StageNode2D.getStageBounds()).
    • isPointerReleased

      default boolean isPointerReleased(Rect bounds)
      Convenience method that returns true if any of the pointer devices has been released within the specified bounds.
    • isPointerReleased

      default boolean isPointerReleased(StageNode2D node)
      Convenience method that returns true if any of the pointers is currently released within the specified node's bounds (as described by StageNode2D.getStageBounds()).
    • clearPointerState

      @Deprecated void clearPointerState()
      Deprecated.
      Prefer using Pointer.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 using Pointer.clearState() on all pointers.
    • isTouchAvailable

      boolean isTouchAvailable()
    • isKeyboardAvailable

      boolean isKeyboardAvailable()
    • isKeyPressed

      boolean isKeyPressed(KeyCode keyCode)
      Returns true if the key with the specified key code was pressed during the current frame.
    • isKeyReleased

      boolean isKeyReleased(KeyCode keyCode)
      Returns true if the key with the specified key code was released during the current frame.
    • requestTextInput

      nl.colorize.util.EventQueue<String> requestTextInput(String label, String initialValue)
      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

      void fillClipboard(String text)
      Copies the specified text to the system clipboard.