Package gaiasky.gui
Class MouseKbdListener
java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.input.GestureDetector
gaiasky.gui.MouseKbdListener
- All Implemented Interfaces:
com.badlogic.gdx.InputProcessor,IInputListener
- Direct Known Subclasses:
GameMouseKbdListener,NaturalMouseKbdListener
public abstract class MouseKbdListener
extends com.badlogic.gdx.input.GestureDetector
implements IInputListener
-
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
FieldsModifier and TypeFieldDescriptionprotected NaturalCameraprotected com.badlogic.gdx.utils.IntSetHolds the pressed keys at any moment -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMouseKbdListener(com.badlogic.gdx.input.GestureDetector.GestureListener gl, NaturalCamera camera) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPressedKey(int keycode) booleanallPressed(int... keys) Returns true if all keys are pressedbooleananyPressed(int... keys) Returns true if any of the keys are pressedfloatbooleanisKeyPressed(int keycode) booleankeyDown(int keycode) booleankeyUp(int keycode) voidremovePressedKey(int keycode) Methods inherited from class com.badlogic.gdx.input.GestureDetector
cancel, invalidateTapSquare, isLongPressed, isLongPressed, isPanning, reset, setLongPressSeconds, setMaxFlingDelay, setTapCountInterval, setTapRectangleSize, setTapSquareSize, touchDown, touchDown, touchDragged, touchDragged, touchUp, touchUpMethods inherited from class com.badlogic.gdx.InputAdapter
keyTyped, mouseMoved, scrolledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gaiasky.gui.IInputListener
activate, deactivate, update
-
Field Details
-
camera
-
pressedKeys
protected com.badlogic.gdx.utils.IntSet pressedKeysHolds the pressed keys at any moment
-
-
Constructor Details
-
MouseKbdListener
protected MouseKbdListener(com.badlogic.gdx.input.GestureDetector.GestureListener gl, NaturalCamera camera)
-
-
Method Details
-
addPressedKey
public void addPressedKey(int keycode) -
removePressedKey
public void removePressedKey(int keycode) -
keyDown
public boolean keyDown(int keycode) - Specified by:
keyDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyDownin classcom.badlogic.gdx.InputAdapter
-
keyUp
public boolean keyUp(int keycode) - Specified by:
keyUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyUpin classcom.badlogic.gdx.InputAdapter
-
isKeyPressed
public boolean isKeyPressed(int keycode) -
allPressed
public boolean allPressed(int... keys) Returns true if all keys are pressed- Parameters:
keys- The keys to test- Returns:
- True if all are pressed
-
anyPressed
public boolean anyPressed(int... keys) Returns true if any of the keys are pressed- Parameters:
keys- The keys to test- Returns:
- True if any is pressed
-
getResponseTime
public float getResponseTime()
-