Package com.badlogic.gdx
Class AbstractInput
- java.lang.Object
-
- com.badlogic.gdx.AbstractInput
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.badlogic.gdx.Input
Input.Buttons, Input.Keys, Input.OnscreenKeyboardType, Input.Orientation, Input.Peripheral, Input.TextInputListener, Input.VibrationType
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean[]justPressedKeysprotected booleankeyJustPressedprotected intpressedKeyCountprotected boolean[]pressedKeys
-
Constructor Summary
Constructors Constructor Description AbstractInput()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisCatchBackKey()booleanisCatchKey(int keycode)booleanisCatchMenuKey()booleanisKeyJustPressed(int key)Returns whether the key has just been pressed.booleanisKeyPressed(int key)Returns whether the key is pressed.voidsetCatchBackKey(boolean catchBack)voidsetCatchKey(int keycode, boolean catchKey)Sets whether the given key on Android or GWT should be caught.voidsetCatchMenuKey(boolean catchMenu)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.badlogic.gdx.Input
getAccelerometerX, getAccelerometerY, getAccelerometerZ, getAzimuth, getCurrentEventTime, getDeltaX, getDeltaX, getDeltaY, getDeltaY, getGyroscopeX, getGyroscopeY, getGyroscopeZ, getInputProcessor, getMaxPointers, getNativeOrientation, getPitch, getPressure, getPressure, getRoll, getRotation, getRotationMatrix, getTextInput, getTextInput, getX, getX, getY, getY, isButtonJustPressed, isButtonPressed, isCursorCatched, isPeripheralAvailable, isTouched, isTouched, justTouched, setCursorCatched, setCursorPosition, setInputProcessor, setOnscreenKeyboardVisible, setOnscreenKeyboardVisible, vibrate, vibrate, vibrate, vibrate
-
-
-
-
Method Detail
-
isKeyPressed
public boolean isKeyPressed(int key)
Description copied from interface:InputReturns whether the key is pressed.- Specified by:
isKeyPressedin interfaceInput- Parameters:
key- The key code as found inInput.Keys.- Returns:
- true or false.
-
isKeyJustPressed
public boolean isKeyJustPressed(int key)
Description copied from interface:InputReturns whether the key has just been pressed.- Specified by:
isKeyJustPressedin interfaceInput- Parameters:
key- The key code as found inInput.Keys.- Returns:
- true or false.
-
isCatchBackKey
public boolean isCatchBackKey()
- Specified by:
isCatchBackKeyin interfaceInput- Returns:
- whether the back button is currently being caught
-
setCatchBackKey
public void setCatchBackKey(boolean catchBack)
- Specified by:
setCatchBackKeyin interfaceInput- Parameters:
catchBack- whether to catch the back button
-
isCatchMenuKey
public boolean isCatchMenuKey()
- Specified by:
isCatchMenuKeyin interfaceInput- Returns:
- whether the menu button is currently being caught
-
setCatchMenuKey
public void setCatchMenuKey(boolean catchMenu)
- Specified by:
setCatchMenuKeyin interfaceInput- Parameters:
catchMenu- whether to catch the menu button
-
setCatchKey
public void setCatchKey(int keycode, boolean catchKey)Description copied from interface:InputSets whether the given key on Android or GWT should be caught. No effect on other platforms. All keys that are not caught may be handled by other apps or background processes on Android, or may trigger default browser behaviour on GWT. For example, media or volume buttons are handled by background media players if present, or Space key triggers a scroll. All keys you need to control your game should be caught to prevent unintended behaviour.- Specified by:
setCatchKeyin interfaceInput- Parameters:
keycode- keycode to catchcatchKey- whether to catch the given keycode
-
isCatchKey
public boolean isCatchKey(int keycode)
- Specified by:
isCatchKeyin interfaceInput- Parameters:
keycode- keycode to check if caught- Returns:
- true if the given keycode is configured to be caught
-
-