public class Input
extends java.lang.Object
Constructor and Description |
---|
Input() |
Modifier and Type | Method and Description |
---|---|
static void |
debugPrintKeyEvents(boolean shouldDebugKeys)
Prints all newly received key events to console when this is set to true until manually set to false.
|
static java.util.List<java.lang.String> |
getAllDownChars()
Gets all currently pressed chars as lowercase strings in a list.
|
static java.util.List<java.lang.Integer> |
getAllDownCodes()
Gets all currently pressed keys as integer keyCodes in a list.
|
static KeyState |
getChar(java.lang.Character key)
Get the current keyboard button state by using its char value.
|
static KeyState |
getCode(int keyCode)
Get the current keyboard button state by using its keyCode value.
|
static processing.core.PVector |
mouseDelta()
Gets the difference between current frame mouse position and previous frame mouse position as a PVector.
|
static processing.core.PVector |
mousePos()
Get the current mouseX and mouseY as a PVector.
|
static processing.core.PVector |
mousePosLastFrame()
Get pmouseX and pmouseY as a PVector describing the last frame's mouse position.
|
public static KeyState getChar(java.lang.Character key)
getChar('n').down
key
- char representation of the keypublic static KeyState getCode(int keyCode)
getCode(LEFT).down
keyCode
- keyCode representation of the keypublic static java.util.List<java.lang.String> getAllDownChars()
key == CODED
is true like CTRL and DELETE.
The list is sorted in alphabetical order.public static java.util.List<java.lang.Integer> getAllDownCodes()
public static void debugPrintKeyEvents(boolean shouldDebugKeys)
shouldDebugKeys
- should the InputWatcher print all the key events it receives to console?public static processing.core.PVector mousePos()
public static processing.core.PVector mousePosLastFrame()
mouseDelta()
should equal the current mousePos()
public static processing.core.PVector mouseDelta()
new PVector(app.mouseX - app.pmouseX, app.mouseY - app.pmouseY);