Interface InputDevice

  • All Known Implementing Classes:
    AWTInput, GDXInput, TeaInputDevice

    public interface InputDevice
    Used to poll the status of the platform's input devices. Depending on the device, this may consist of a mouse, keyboard, or touch screen. Attempting to access an input device that is not available will result in a UnsupportedOperationException.
    • Method Detail

      • getPointer

        Point getPointer()
      • isPointerPressed

        boolean isPointerPressed()
      • isPointerReleased

        boolean isPointerReleased()
      • isKeyboardAvailable

        boolean isKeyboardAvailable()
      • isKeyPressed

        boolean isKeyPressed​(KeyCode keyCode)
      • isKeyReleased

        boolean isKeyReleased​(KeyCode keyCode)
      • requestTextInput

        @Deprecated
        java.lang.String requestTextInput​(java.lang.String label,
                                          java.lang.String initialValue)
        Deprecated.
        Although this method is necessary for the reasons outlined above, it does lead to user experience issues due to the mix of user interface elements provided by the renderer and those from the native platform.
        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.