Class NaturalMouseKbdListener

java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.input.GestureDetector
gaiasky.interafce.MouseKbdListener
gaiasky.interafce.NaturalMouseKbdListener
All Implemented Interfaces:
com.badlogic.gdx.InputProcessor, IObserver, IInputListener

public class NaturalMouseKbdListener
extends MouseKbdListener
implements IObserver
Input listener for the natural camera.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    protected static class  NaturalMouseKbdListener.GaiaGestureListener  

    Nested classes/interfaces inherited from class com.badlogic.gdx.input.GestureDetector

    com.badlogic.gdx.input.GestureDetector.GestureAdapter, com.badlogic.gdx.input.GestureDetector.GestureListener
  • Field Summary

    Fields
    Modifier and Type Field Description
    boolean alwaysScroll
    Whether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).
    protected int button
    The current (first) button being pressed.
    NaturalMouseKbdListener.GaiaGestureListener gestureListener  
    int leftMouseButton
    The button for rotating the camera either around its center or around the focus.
    int middleMouseButton
    The button for moving the camera along the direction axis
    int rightMouseButton
    The button for panning the camera along the up/right plane
    int rollKey
    The key for rolling the camera
    float scrollFactor
    The weight for each scrolled amount.

    Fields inherited from class gaiasky.interafce.MouseKbdListener

    camera, pressedKeys
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected NaturalMouseKbdListener​(NaturalMouseKbdListener.GaiaGestureListener gestureListener, NaturalCamera camera)  
      NaturalMouseKbdListener​(NaturalCamera camera)  
  • Method Summary

    Modifier and Type Method Description
    void activate()  
    void deactivate()  
    void notify​(Events event, java.lang.Object... data)  
    protected boolean processDrag​(int screenX, int screenY, double deltaX, double deltaY, int button)  
    boolean scrolled​(float amountX, float amountY)  
    boolean touchDown​(int screenX, int screenY, int pointer, int button)  
    boolean touchDragged​(int screenX, int screenY, int pointer)  
    boolean touchUp​(int screenX, int screenY, int pointer, int button)  
    void update()  
    boolean zoom​(float amount)  

    Methods inherited from class com.badlogic.gdx.input.GestureDetector

    cancel, invalidateTapSquare, isLongPressed, isLongPressed, isPanning, reset, setLongPressSeconds, setMaxFlingDelay, setTapCountInterval, setTapRectangleSize, setTapSquareSize, touchDown, touchDragged, touchUp

    Methods inherited from class com.badlogic.gdx.InputAdapter

    keyTyped, mouseMoved

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • leftMouseButton

      public int leftMouseButton
      The button for rotating the camera either around its center or around the focus.
    • rightMouseButton

      public int rightMouseButton
      The button for panning the camera along the up/right plane
    • middleMouseButton

      public int middleMouseButton
      The button for moving the camera along the direction axis
    • alwaysScroll

      public boolean alwaysScroll
      Whether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).
    • scrollFactor

      public float scrollFactor
      The weight for each scrolled amount.
    • rollKey

      public int rollKey
      The key for rolling the camera
    • button

      protected int button
      The current (first) button being pressed.
    • gestureListener

      public final NaturalMouseKbdListener.GaiaGestureListener gestureListener
  • Constructor Details

  • Method Details

    • touchDown

      public boolean touchDown​(int screenX, int screenY, int pointer, int button)
      Specified by:
      touchDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class com.badlogic.gdx.input.GestureDetector
    • touchUp

      public boolean touchUp​(int screenX, int screenY, int pointer, int button)
      Specified by:
      touchUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchUp in class com.badlogic.gdx.input.GestureDetector
    • processDrag

      protected boolean processDrag​(int screenX, int screenY, double deltaX, double deltaY, int button)
    • touchDragged

      public boolean touchDragged​(int screenX, int screenY, int pointer)
      Specified by:
      touchDragged in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDragged in class com.badlogic.gdx.input.GestureDetector
    • scrolled

      public boolean scrolled​(float amountX, float amountY)
      Specified by:
      scrolled in interface com.badlogic.gdx.InputProcessor
      Overrides:
      scrolled in class com.badlogic.gdx.InputAdapter
    • zoom

      public boolean zoom​(float amount)
    • update

      public void update()
      Specified by:
      update in interface IInputListener
    • activate

      public void activate()
      Specified by:
      activate in interface IInputListener
    • deactivate

      public void deactivate()
      Specified by:
      deactivate in interface IInputListener
    • notify

      public void notify​(Events event, java.lang.Object... data)
      Specified by:
      notify in interface IObserver