public class SquidKey
extends java.lang.Object
implements com.badlogic.gdx.InputProcessor
Constructor and Description |
---|
SquidKey()
Constructs a SquidKey with no InputProcessor; for this to do anything, setProcessor() must be called.
|
SquidKey(com.badlogic.gdx.InputProcessor processor)
Constructs a SquidKey with the given InputProcessor.
|
SquidKey(com.badlogic.gdx.InputProcessor processor,
boolean ignoreInput)
Constructs a SquidKey with the given InputProcessor.
|
Modifier and Type | Method and Description |
---|---|
void |
drain()
Processes all events queued up, passing them to this object's InputProcessor.
|
void |
flush()
Empties the backing queue of data.
|
boolean |
getIgnoreInput()
Get the status for whether this should ignore input right now or not.
|
com.badlogic.gdx.InputProcessor |
getProcessor()
Gets this object's InputProcessor.
|
boolean |
hasNext()
Returns true if at least one event is queued.
|
boolean |
keyDown(int keycode) |
boolean |
keyTyped(char character) |
boolean |
keyUp(int keycode) |
boolean |
mouseMoved(int screenX,
int screenY) |
void |
next()
Processes the first event queued up, passing it to this object's InputProcessor.
|
boolean |
scrolled(float amountX,
float amountY) |
void |
setIgnoreInput(boolean ignoreInput)
Set the status for whether this should ignore input right now or not.
|
void |
setProcessor(com.badlogic.gdx.InputProcessor processor)
Sets the InputProcessor that this object will use to make sense of Key events.
|
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) |
public SquidKey()
public SquidKey(com.badlogic.gdx.InputProcessor processor)
processor
- An InputProcessor that will handle keyDown(), keyUp(), and keyTyped() eventspublic SquidKey(com.badlogic.gdx.InputProcessor processor, boolean ignoreInput)
processor
- An InputProcessor that will handle keyDown(), keyUp(), and keyTyped() eventsignoreInput
- the starting value for the ignore status; true to ignore input, false to process it.public void setProcessor(com.badlogic.gdx.InputProcessor processor)
processor
- An InputProcessor that will handle keyDown(), keyUp(), and keyTyped() eventspublic com.badlogic.gdx.InputProcessor getProcessor()
public boolean getIgnoreInput()
public void setIgnoreInput(boolean ignoreInput)
ignoreInput
- true if this should object should ignore and not queue input, false otherwise.public void drain()
public boolean hasNext()
public void next()
public void flush()
public boolean keyDown(int keycode)
keyDown
in interface com.badlogic.gdx.InputProcessor
public boolean keyUp(int keycode)
keyUp
in interface com.badlogic.gdx.InputProcessor
public boolean keyTyped(char character)
keyTyped
in interface com.badlogic.gdx.InputProcessor
public boolean touchDown(int screenX, int screenY, int pointer, int button)
touchDown
in interface com.badlogic.gdx.InputProcessor
public boolean touchUp(int screenX, int screenY, int pointer, int button)
touchUp
in interface com.badlogic.gdx.InputProcessor
public boolean touchDragged(int screenX, int screenY, int pointer)
touchDragged
in interface com.badlogic.gdx.InputProcessor
public boolean mouseMoved(int screenX, int screenY)
mouseMoved
in interface com.badlogic.gdx.InputProcessor
public boolean scrolled(float amountX, float amountY)
scrolled
in interface com.badlogic.gdx.InputProcessor
Copyright © Eben Howard 2012–2022. All rights reserved.