Package gaiasky.interfce
Class NaturalMouseKbdListener
- java.lang.Object
-
- com.badlogic.gdx.InputAdapter
-
- com.badlogic.gdx.input.GestureDetector
-
- gaiasky.interfce.MouseKbdListener
-
- gaiasky.interfce.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 classNaturalMouseKbdListener.GaiaGestureListener
-
Field Summary
Fields Modifier and Type Field Description booleanalwaysScrollWhether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).protected intbuttonThe current (first) button being pressed.NaturalMouseKbdListener.GaiaGestureListenergestureListenerintleftMouseButtonThe button for rotating the camera either around its center or around the focus.intmiddleMouseButtonThe button for moving the camera along the direction axisintrightMouseButtonThe button for panning the camera along the up/right planeintrollKeyThe key for rolling the camerafloatscrollFactorThe weight for each scrolled amount.-
Fields inherited from class gaiasky.interfce.MouseKbdListener
camera, pressedKeys
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNaturalMouseKbdListener(NaturalMouseKbdListener.GaiaGestureListener gestureListener, NaturalCamera camera)NaturalMouseKbdListener(NaturalCamera camera)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()voiddeactivate()voidnotify(Events event, java.lang.Object... data)protected booleanprocessDrag(int screenX, int screenY, double deltaX, double deltaY, int button)booleanscrolled(int amount)booleantouchDown(int screenX, int screenY, int pointer, int button)booleantouchDragged(int screenX, int screenY, int pointer)booleantouchUp(int screenX, int screenY, int pointer, int button)voidupdate()booleanzoom(float amount)-
Methods inherited from class gaiasky.interfce.MouseKbdListener
addPressedKey, allPressed, anyPressed, getResponseTime, isKeyPressed, keyDown, keyUp, removePressedKey
-
-
-
-
Field Detail
-
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 Detail
-
NaturalMouseKbdListener
protected NaturalMouseKbdListener(NaturalMouseKbdListener.GaiaGestureListener gestureListener, NaturalCamera camera)
-
NaturalMouseKbdListener
public NaturalMouseKbdListener(NaturalCamera camera)
-
-
Method Detail
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button)- Specified by:
touchDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchDownin classcom.badlogic.gdx.input.GestureDetector
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button)- Specified by:
touchUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchUpin classcom.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:
touchDraggedin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchDraggedin classcom.badlogic.gdx.input.GestureDetector
-
scrolled
public boolean scrolled(int amount)
- Specified by:
scrolledin interfacecom.badlogic.gdx.InputProcessor- Overrides:
scrolledin classcom.badlogic.gdx.InputAdapter
-
zoom
public boolean zoom(float amount)
-
update
public void update()
- Specified by:
updatein interfaceIInputListener
-
activate
public void activate()
- Specified by:
activatein interfaceIInputListener
-
deactivate
public void deactivate()
- Specified by:
deactivatein interfaceIInputListener
-
-