Class AndroidMouseInput14

java.lang.Object
com.jme3.input.android.AndroidMouseInput14
All Implemented Interfaces:
Input, MouseInput
Direct Known Subclasses:
AndroidMouseInput24

public class AndroidMouseInput14 extends Object implements MouseInput
AndroidMouseInput14 implements MouseInput to add mouse support for jME3 uses the onGenericMotion events that where added in Android rev 12 and MotionEvent.getButtonState from Android rev 14 so added "14" suffix to the class to specify the Android required rev and match other classes naming
  • Field Details

  • Constructor Details

  • Method Details

    • getJmeX

      protected int getJmeX(float origX)
    • getJmeY

      protected int getJmeY(float origY)
    • loadSettings

      public void loadSettings(AppSettings settings)
    • addMouseMotionEventFixedPositions

      protected void addMouseMotionEventFixedPositions(int x, int y, int deltaWheel)
    • addMouseMotionEventRelativePositions

      protected void addMouseMotionEventRelativePositions(int deltaX, int deltaY, int deltaWheel)
    • addMouseButtonEvent

      protected boolean addMouseButtonEvent(boolean left, boolean right, boolean center, int x, int y)
    • onHover

      public boolean onHover(android.view.MotionEvent event)
    • onGenericMotion

      public boolean onGenericMotion(android.view.MotionEvent event)
    • setCursorVisible

      public void setCursorVisible(boolean visible)
      Description copied from interface: MouseInput
      Set whether the mouse cursor should be visible or not.
      Specified by:
      setCursorVisible in interface MouseInput
      Parameters:
      visible - Whether the mouse cursor should be visible or not.
    • getButtonCount

      public int getButtonCount()
      Description copied from interface: MouseInput
      Returns the number of buttons the mouse has. Typically 3 for most mice.
      Specified by:
      getButtonCount in interface MouseInput
      Returns:
      the number of buttons the mouse has.
    • setNativeCursor

      public void setNativeCursor(JmeCursor cursor)
      Description copied from interface: MouseInput
      Sets the cursor to use.
      Specified by:
      setNativeCursor in interface MouseInput
      Parameters:
      cursor - The cursor to use.
    • initialize

      public void initialize()
      Description copied from interface: Input
      Initializes the native side to listen into events from the device.
      Specified by:
      initialize in interface Input
    • update

      public void update()
      Description copied from interface: Input
      Queries the device for input. All events should be sent to the RawInputListener set with setInputListener.
      Specified by:
      update in interface Input
      See Also:
    • destroy

      public void destroy()
      Description copied from interface: Input
      Ceases listening to events from the device.
      Specified by:
      destroy in interface Input
    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface Input
      Returns:
      True if the device has been initialized and not destroyed.
      See Also:
    • setInputListener

      public void setInputListener(RawInputListener listener)
      Description copied from interface: Input
      Sets the input listener to receive events from this device. The appropriate events should be dispatched through the callbacks in RawInputListener.
      Specified by:
      setInputListener in interface Input
      Parameters:
      listener - the desired listener
    • getInputTimeNanos

      public long getInputTimeNanos()
      Specified by:
      getInputTimeNanos in interface Input
      Returns:
      The current absolute time as nanoseconds. This time is expected to be relative to the time given in InputEvents time property.