Class GDXInput

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GDXInput()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Point2D> getPointers()
      Returns the current locations of all currently active pointers.
      boolean isKeyboardAvailable()
      Returns true if the current device has a hardware keyboard.
      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 isPointerPressed​(Rect area)
      Returns true if any of the currently active pointers have been pressed and located within the specified area during the current frame.
      boolean isPointerReleased​(Rect area)
      Returns true if any of the currently active pointers were released and located within the specified area during the current frame.
      boolean isTouchAvailable()
      Returns if the current device supports touch input.
      java.lang.String requestTextInput​(java.lang.String labelText, java.lang.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
    • Constructor Detail

      • GDXInput

        protected GDXInput()
    • Method Detail

      • update

        public void update​(float deltaTime)
        Description copied from interface: Updatable
        Updates this object for the current frame.
        Specified by:
        update in interface Updatable
        Parameters:
        deltaTime - Elapsed time since the last frame, in seconds.
      • getPointers

        public java.util.List<Point2D> getPointers()
        Description copied from interface: InputDevice
        Returns the current locations of all currently active pointers. When using a mouse, this will always return a list with a single element. For touch controls, the list could also have multiple elements (during multi-touch gestures) or the list could be empty (unlike mouse events, touch coordinates are only available during the event itself).
        Specified by:
        getPointers in interface InputDevice
      • isPointerPressed

        public boolean isPointerPressed​(Rect area)
        Description copied from interface: InputDevice
        Returns true if any of the currently active pointers have been pressed and located within the specified area during the current frame.
        Specified by:
        isPointerPressed in interface InputDevice
      • isPointerReleased

        public boolean isPointerReleased​(Rect area)
        Description copied from interface: InputDevice
        Returns true if any of the currently active pointers were released and located within the specified area during the current frame.
        Specified by:
        isPointerReleased in interface InputDevice
      • isKeyboardAvailable

        public boolean isKeyboardAvailable()
        Description copied from interface: InputDevice
        Returns true if the current device has a hardware keyboard.
        Specified by:
        isKeyboardAvailable in interface InputDevice
      • isKeyPressed

        public boolean isKeyPressed​(KeyCode keyCode)
        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 interface InputDevice
      • isKeyReleased

        public boolean isKeyReleased​(KeyCode keyCode)
        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 interface InputDevice
      • requestTextInput

        public java.lang.String requestTextInput​(java.lang.String labelText,
                                                 java.lang.String initialValue)
        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 interface InputDevice