Package gaiasky.input

Class MainMouseKbdListener

java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.input.GestureDetector
gaiasky.input.AbstractMouseKbdListener
gaiasky.input.MainMouseKbdListener
All Implemented Interfaces:
com.badlogic.gdx.InputProcessor, IObserver, IInputListener

public class MainMouseKbdListener extends AbstractMouseKbdListener implements IObserver
Mouse and keyboard input listener for the natural camera.
  • Field Details

    • gestureListener

      public final MainMouseKbdListener.GaiaGestureListener gestureListener
    • 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.
  • 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)
    • pollKeys

      public boolean pollKeys()
      Description copied from class: AbstractMouseKbdListener
      Implement key polling here.
      Specified by:
      pollKeys in class AbstractMouseKbdListener
      Returns:
      True if an action was successfully executed.
    • notify

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.