Package arc.input
Class KeyboardDevice
java.lang.Object
arc.input.InputDevice
arc.input.KeyboardDevice
- All Implemented Interfaces:
InputProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from class arc.input.InputDevice
InputDevice.DeviceType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
boolean
boolean
isReleased
(KeyCode key) boolean
boolean
Called when a key was pressedboolean
Called when a key was releasedname()
void
Called at the end of the update loop.boolean
scrolled
(float amountX, float amountY) Called when the mouse wheel was scrolled.boolean
boolean
type()
Methods inherited from class arc.input.InputDevice
preUpdate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.input.InputProcessor
connected, disconnected, keyTyped, mouseMoved, touchDragged
-
Constructor Details
-
KeyboardDevice
public KeyboardDevice()
-
-
Method Details
-
postUpdate
public void postUpdate()Description copied from class:InputDevice
Called at the end of the update loop.- Overrides:
postUpdate
in classInputDevice
-
isPressed
- Specified by:
isPressed
in classInputDevice
- Returns:
- whether the button is currently pressed.
-
isTapped
- Specified by:
isTapped
in classInputDevice
- Returns:
- whether button was pressed down this frame.
-
isReleased
- Specified by:
isReleased
in classInputDevice
- Returns:
- whether this button was released this frame.
-
getAxis
- Specified by:
getAxis
in classInputDevice
- Returns:
- an axis tilt value, usually -1 to 1; 0 for non-axes.
-
keyDown
Description copied from interface:InputProcessor
Called when a key was pressed- Specified by:
keyDown
in interfaceInputProcessor
- Returns:
- whether the input was processed
-
keyUp
Description copied from interface:InputProcessor
Called when a key was released- Specified by:
keyUp
in interfaceInputProcessor
- Returns:
- whether the input was processed
-
touchDown
- Specified by:
touchDown
in interfaceInputProcessor
- Parameters:
screenX
- The x coordinate, origin is in the upper left cornerscreenY
- The y coordinate, origin is in the upper left cornerpointer
- the pointer for the event.button
- the button- Returns:
- whether the input was processed
-
touchUp
- Specified by:
touchUp
in interfaceInputProcessor
pointer
- the pointer for the event.button
- the button- Returns:
- whether the input was processed
-
scrolled
public boolean scrolled(float amountX, float amountY) Description copied from interface:InputProcessor
Called when the mouse wheel was scrolled. Will not be called on iOS.- Specified by:
scrolled
in interfaceInputProcessor
- Parameters:
amountX
- the horizontal scroll amount, negative or positive depending on the direction the wheel was scrolled.amountY
- the vertical scroll amount, negative or positive depending on the direction the wheel was scrolled.- Returns:
- whether the input was processed.
-
name
- Specified by:
name
in classInputDevice
-
type
- Specified by:
type
in classInputDevice
-