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
Mouse and keyboard input listener for the natural camera.
-
Nested Class Summary
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
Modifier and TypeFieldDescriptionboolean
Whether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true).protected int
The current (first) button being pressed.int
The button for rotating the camera either around its center or around the focus.int
The button for moving the camera along the direction axisint
The button for panning the camera along the up/right planeint
The key for rolling the camerafloat
The weight for each scrolled amount.Fields inherited from class gaiasky.input.AbstractMouseKbdListener
active, iCamera, lastPollTime, minPollInterval, minPollTime
-
Constructor Summary
ModifierConstructorDescriptionprotected
MainMouseKbdListener
(MainMouseKbdListener.GaiaGestureListener gestureListener, NaturalCamera camera) MainMouseKbdListener
(NaturalCamera camera) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Event notification call.boolean
pollKeys()
Implement key polling here.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) boolean
zoom
(float amount) Methods inherited from class gaiasky.input.AbstractMouseKbdListener
activate, allPressed, anyPressed, deactivate, getResponseTime, isActive, isKeyPressed, keyDown, keyUp, update
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
-
Field Details
-
gestureListener
-
leftMouseButton
public int leftMouseButtonThe button for rotating the camera either around its center or around the focus. -
rightMouseButton
public int rightMouseButtonThe button for panning the camera along the up/right plane -
middleMouseButton
public int middleMouseButtonThe button for moving the camera along the direction axis -
alwaysScroll
public boolean alwaysScrollWhether scrolling requires the activeKey to be pressed (false) or always allow scrolling (true). -
scrollFactor
public float scrollFactorThe weight for each scrolled amount. -
rollKey
public int rollKeyThe key for rolling the camera -
button
protected int buttonThe current (first) button being pressed.
-
-
Constructor Details
-
MainMouseKbdListener
protected MainMouseKbdListener(MainMouseKbdListener.GaiaGestureListener gestureListener, NaturalCamera camera) -
MainMouseKbdListener
-
-
Method Details
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) - Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classcom.badlogic.gdx.input.GestureDetector
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) - Specified by:
touchUp
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchUp
in 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:
touchDragged
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDragged
in classcom.badlogic.gdx.input.GestureDetector
-
scrolled
public boolean scrolled(float amountX, float amountY) - Specified by:
scrolled
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
scrolled
in classcom.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 classAbstractMouseKbdListener
- Returns:
- True if an action was successfully executed.
-
notify
Description copied from interface:IObserver
Event notification call.
-