PulpCore

pulpcore
Class Input

java.lang.Object
  extended by pulpcore.Input

public final class Input
extends Object

The Input class provides an easy way to check the state of the keyboard keys, the mouse buttons, and the mouse location.

Mouse buttons and keyboard keys are both treated as "virtual keys". Virtual keys have four states: UP, DOWN, PRESSED, and RELEASED. The states only change when polled, which occurs before each call to Scene.update().

StateDescription
UPThe key is up.
DOWNThe key is down.
PRESSEDThe key was pressed since the last poll.
RELEASEDThe key was released since the last poll.

If a key was both pressed and released between polls, the key state will be PRESSED, and on the next poll the key state will be RELEASED.


Field Summary
static int CURSOR_CROSSHAIR
           
static int CURSOR_DEFAULT
           
static int CURSOR_E_RESIZE
           
static int CURSOR_HAND
           
static int CURSOR_MOVE
           
static int CURSOR_N_RESIZE
           
static int CURSOR_NE_RESIZE
           
static int CURSOR_NW_RESIZE
           
static int CURSOR_OFF
           
static int CURSOR_S_RESIZE
           
static int CURSOR_SE_RESIZE
           
static int CURSOR_SW_RESIZE
           
static int CURSOR_TEXT
           
static int CURSOR_W_RESIZE
           
static int CURSOR_WAIT
           
static int DOWN
          The virtual key state indicating that a key is down.
static int KEY_0
           
static int KEY_1
           
static int KEY_2
           
static int KEY_3
           
static int KEY_4
           
static int KEY_5
           
static int KEY_6
           
static int KEY_7
           
static int KEY_8
           
static int KEY_9
           
static int KEY_A
           
static int KEY_ADD
           
static int KEY_B
           
static int KEY_BACK_QUOTE
           
static int KEY_BACK_SLASH
           
static int KEY_BACK_SPACE
           
static int KEY_C
           
static int KEY_CAPS_LOCK
           
static int KEY_CLOSE_BRACKET
           
static int KEY_COMMA
           
static int KEY_D
           
static int KEY_DECIMAL
           
static int KEY_DELETE
           
static int KEY_DIVIDE
           
static int KEY_DOUBLE_MOUSE_BUTTON_1
           
static int KEY_DOUBLE_MOUSE_BUTTON_2
           
static int KEY_DOUBLE_MOUSE_BUTTON_3
           
static int KEY_DOWN
           
static int KEY_E
           
static int KEY_END
           
static int KEY_ENTER
           
static int KEY_EQUALS
           
static int KEY_ESCAPE
           
static int KEY_F
           
static int KEY_F1
           
static int KEY_F10
           
static int KEY_F11
           
static int KEY_F12
           
static int KEY_F13
           
static int KEY_F14
           
static int KEY_F15
           
static int KEY_F16
           
static int KEY_F17
           
static int KEY_F18
           
static int KEY_F19
           
static int KEY_F2
           
static int KEY_F20
           
static int KEY_F21
           
static int KEY_F22
           
static int KEY_F23
           
static int KEY_F24
           
static int KEY_F3
           
static int KEY_F4
           
static int KEY_F5
           
static int KEY_F6
           
static int KEY_F7
           
static int KEY_F8
           
static int KEY_F9
           
static int KEY_G
           
static int KEY_H
           
static int KEY_HOME
           
static int KEY_I
           
static int KEY_INSERT
           
static int KEY_J
           
static int KEY_K
           
static int KEY_L
           
static int KEY_LEFT
           
static int KEY_LEFT_ALT
           
static int KEY_LEFT_CONTROL
           
static int KEY_LEFT_META
           
static int KEY_LEFT_SHIFT
           
static int KEY_M
           
static int KEY_MINUS
           
static int KEY_MOUSE_BUTTON_1
           
static int KEY_MOUSE_BUTTON_2
           
static int KEY_MOUSE_BUTTON_3
           
static int KEY_MULTIPLY
           
static int KEY_N
           
static int KEY_NUM_LOCK
           
static int KEY_NUMPAD0
           
static int KEY_NUMPAD1
           
static int KEY_NUMPAD2
           
static int KEY_NUMPAD3
           
static int KEY_NUMPAD4
           
static int KEY_NUMPAD5
           
static int KEY_NUMPAD6
           
static int KEY_NUMPAD7
           
static int KEY_NUMPAD8
           
static int KEY_NUMPAD9
           
static int KEY_O
           
static int KEY_OPEN_BRACKET
           
static int KEY_P
           
static int KEY_PAGE_DOWN
           
static int KEY_PAGE_UP
           
static int KEY_PAUSE
           
static int KEY_PERIOD
           
static int KEY_PRINT_SCREEN
           
static int KEY_Q
           
static int KEY_QUOTE
           
static int KEY_R
           
static int KEY_RIGHT
           
static int KEY_RIGHT_ALT
           
static int KEY_RIGHT_CONTROL
           
static int KEY_RIGHT_META
           
static int KEY_RIGHT_SHIFT
           
static int KEY_S
           
static int KEY_SCROLL_LOCK
           
static int KEY_SEMICOLON
           
static int KEY_SEPARATOR
           
static int KEY_SLASH
           
static int KEY_SPACE
           
static int KEY_SUBTRACT
           
static int KEY_T
           
static int KEY_TAB
           
static int KEY_TRIPLE_MOUSE_BUTTON_1
           
static int KEY_TRIPLE_MOUSE_BUTTON_2
           
static int KEY_TRIPLE_MOUSE_BUTTON_3
           
static int KEY_U
           
static int KEY_UP
           
static int KEY_V
           
static int KEY_W
           
static int KEY_X
           
static int KEY_Y
           
static int KEY_Z
           
static int NUM_KEY_CODES
           
static int PRESSED
          The virtual key state indicating that a key is pressed.
static int RELEASED
          The virtual key state indicating that a key is released.
static int REPEATED
          The virtual key state indicating that a key is repeated.
static int UP
          The virtual key state indicating that a key is up.
 
Method Summary
static int getCursor()
           
static int getMousePressX()
          Gets the x location of the last mouse press.
static int getMousePressY()
          Gets the y location of the last mouse press.
static int getMouseReleaseX()
          Gets the x location of the last mouse release.
static int getMouseReleaseY()
          Gets the y location of the last mouse release.
static int getMouseWheelRotation()
          Returns the number of clicks the mouse wheel was rotated since the last poll.
static int getMouseWheelX()
          Gets the x location of the last mouse wheel rotation.
static int getMouseWheelY()
          Gets the y location of the last mouse wheel rotation.
static int getMouseX()
           
static int getMouseY()
           
static int getState(int keyCode)
           
static String getTypedChars()
          Returns the keyboard character input received since the last poll.
static boolean hasKeyboardFocus()
           
static boolean isAltDown()
          Checks if either the left ALT key or the right ALT key is currently down.
static boolean isControlDown()
          Checks if either the left control (CTRL) key or the right control key is currently down.
static boolean isDown(int keyCode)
           
static boolean isDown(int[] keyCodes)
          Checks a list of key codes and returns true if at least one key is down.
static boolean isMetaDown()
          Checks if either the left meta key or the right meta key is currently down.
static boolean isMouseDown()
          Returns true if the primary mouse button is down.
static boolean isMouseInside()
          Returns true if the mouse is inside the Stage.
static boolean isMouseMoving()
           
static boolean isMousePressed()
          Returns true if the primary mouse button is pressed.
static boolean isMouseReleased()
          Returns true if the primary mouse button is released.
static boolean isPressed(int keyCode)
           
static boolean isPressed(int[] keyCodes)
          Checks a list of key codes and returns true if at least one key is pressed and no other keys are down.
static boolean isReleased(int keyCode)
           
static boolean isReleased(int[] keyCodes)
          Checks a list of key codes and returns true if at least one key is released and no other keys are down.
static boolean isShiftDown()
          Checks if either the left shift key or the right shift key is currently down.
static boolean isTyped(int keyCode)
           
static void requestKeyboardFocus()
           
static void setCursor(int cursorCode)
          Sets the cursor type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UP

public static final int UP
The virtual key state indicating that a key is up.

See Also:
getState(int), Constant Field Values

DOWN

public static final int DOWN
The virtual key state indicating that a key is down.

See Also:
getState(int), Constant Field Values

PRESSED

public static final int PRESSED
The virtual key state indicating that a key is pressed.

See Also:
getState(int), Constant Field Values

RELEASED

public static final int RELEASED
The virtual key state indicating that a key is released.

See Also:
getState(int), Constant Field Values

REPEATED

public static final int REPEATED
The virtual key state indicating that a key is repeated. This happens when a keyboard key is held down and is OS dependent.

See Also:
getState(int), Constant Field Values

CURSOR_DEFAULT

public static final int CURSOR_DEFAULT
See Also:
Constant Field Values

CURSOR_OFF

public static final int CURSOR_OFF
See Also:
Constant Field Values

CURSOR_HAND

public static final int CURSOR_HAND
See Also:
Constant Field Values

CURSOR_CROSSHAIR

public static final int CURSOR_CROSSHAIR
See Also:
Constant Field Values

CURSOR_MOVE

public static final int CURSOR_MOVE
See Also:
Constant Field Values

CURSOR_TEXT

public static final int CURSOR_TEXT
See Also:
Constant Field Values

CURSOR_WAIT

public static final int CURSOR_WAIT
See Also:
Constant Field Values

CURSOR_N_RESIZE

public static final int CURSOR_N_RESIZE
See Also:
Constant Field Values

CURSOR_S_RESIZE

public static final int CURSOR_S_RESIZE
See Also:
Constant Field Values

CURSOR_W_RESIZE

public static final int CURSOR_W_RESIZE
See Also:
Constant Field Values

CURSOR_E_RESIZE

public static final int CURSOR_E_RESIZE
See Also:
Constant Field Values

CURSOR_NW_RESIZE

public static final int CURSOR_NW_RESIZE
See Also:
Constant Field Values

CURSOR_NE_RESIZE

public static final int CURSOR_NE_RESIZE
See Also:
Constant Field Values

CURSOR_SW_RESIZE

public static final int CURSOR_SW_RESIZE
See Also:
Constant Field Values

CURSOR_SE_RESIZE

public static final int CURSOR_SE_RESIZE
See Also:
Constant Field Values

KEY_MOUSE_BUTTON_1

public static final int KEY_MOUSE_BUTTON_1
See Also:
Constant Field Values

KEY_MOUSE_BUTTON_2

public static final int KEY_MOUSE_BUTTON_2
See Also:
Constant Field Values

KEY_MOUSE_BUTTON_3

public static final int KEY_MOUSE_BUTTON_3
See Also:
Constant Field Values

KEY_BACK_SPACE

public static final int KEY_BACK_SPACE
See Also:
Constant Field Values

KEY_TAB

public static final int KEY_TAB
See Also:
Constant Field Values

KEY_ENTER

public static final int KEY_ENTER
See Also:
Constant Field Values

KEY_PAUSE

public static final int KEY_PAUSE
See Also:
Constant Field Values

KEY_CAPS_LOCK

public static final int KEY_CAPS_LOCK
See Also:
Constant Field Values

KEY_ESCAPE

public static final int KEY_ESCAPE
See Also:
Constant Field Values

KEY_SPACE

public static final int KEY_SPACE
See Also:
Constant Field Values

KEY_PAGE_UP

public static final int KEY_PAGE_UP
See Also:
Constant Field Values

KEY_PAGE_DOWN

public static final int KEY_PAGE_DOWN
See Also:
Constant Field Values

KEY_END

public static final int KEY_END
See Also:
Constant Field Values

KEY_HOME

public static final int KEY_HOME
See Also:
Constant Field Values

KEY_LEFT

public static final int KEY_LEFT
See Also:
Constant Field Values

KEY_UP

public static final int KEY_UP
See Also:
Constant Field Values

KEY_RIGHT

public static final int KEY_RIGHT
See Also:
Constant Field Values

KEY_DOWN

public static final int KEY_DOWN
See Also:
Constant Field Values

KEY_PRINT_SCREEN

public static final int KEY_PRINT_SCREEN
See Also:
Constant Field Values

KEY_INSERT

public static final int KEY_INSERT
See Also:
Constant Field Values

KEY_DELETE

public static final int KEY_DELETE
See Also:
Constant Field Values

KEY_0

public static final int KEY_0
See Also:
Constant Field Values

KEY_1

public static final int KEY_1
See Also:
Constant Field Values

KEY_2

public static final int KEY_2
See Also:
Constant Field Values

KEY_3

public static final int KEY_3
See Also:
Constant Field Values

KEY_4

public static final int KEY_4
See Also:
Constant Field Values

KEY_5

public static final int KEY_5
See Also:
Constant Field Values

KEY_6

public static final int KEY_6
See Also:
Constant Field Values

KEY_7

public static final int KEY_7
See Also:
Constant Field Values

KEY_8

public static final int KEY_8
See Also:
Constant Field Values

KEY_9

public static final int KEY_9
See Also:
Constant Field Values

KEY_A

public static final int KEY_A
See Also:
Constant Field Values

KEY_B

public static final int KEY_B
See Also:
Constant Field Values

KEY_C

public static final int KEY_C
See Also:
Constant Field Values

KEY_D

public static final int KEY_D
See Also:
Constant Field Values

KEY_E

public static final int KEY_E
See Also:
Constant Field Values

KEY_F

public static final int KEY_F
See Also:
Constant Field Values

KEY_G

public static final int KEY_G
See Also:
Constant Field Values

KEY_H

public static final int KEY_H
See Also:
Constant Field Values

KEY_I

public static final int KEY_I
See Also:
Constant Field Values

KEY_J

public static final int KEY_J
See Also:
Constant Field Values

KEY_K

public static final int KEY_K
See Also:
Constant Field Values

KEY_L

public static final int KEY_L
See Also:
Constant Field Values

KEY_M

public static final int KEY_M
See Also:
Constant Field Values

KEY_N

public static final int KEY_N
See Also:
Constant Field Values

KEY_O

public static final int KEY_O
See Also:
Constant Field Values

KEY_P

public static final int KEY_P
See Also:
Constant Field Values

KEY_Q

public static final int KEY_Q
See Also:
Constant Field Values

KEY_R

public static final int KEY_R
See Also:
Constant Field Values

KEY_S

public static final int KEY_S
See Also:
Constant Field Values

KEY_T

public static final int KEY_T
See Also:
Constant Field Values

KEY_U

public static final int KEY_U
See Also:
Constant Field Values

KEY_V

public static final int KEY_V
See Also:
Constant Field Values

KEY_W

public static final int KEY_W
See Also:
Constant Field Values

KEY_X

public static final int KEY_X
See Also:
Constant Field Values

KEY_Y

public static final int KEY_Y
See Also:
Constant Field Values

KEY_Z

public static final int KEY_Z
See Also:
Constant Field Values

KEY_NUMPAD0

public static final int KEY_NUMPAD0
See Also:
Constant Field Values

KEY_NUMPAD1

public static final int KEY_NUMPAD1
See Also:
Constant Field Values

KEY_NUMPAD2

public static final int KEY_NUMPAD2
See Also:
Constant Field Values

KEY_NUMPAD3

public static final int KEY_NUMPAD3
See Also:
Constant Field Values

KEY_NUMPAD4

public static final int KEY_NUMPAD4
See Also:
Constant Field Values

KEY_NUMPAD5

public static final int KEY_NUMPAD5
See Also:
Constant Field Values

KEY_NUMPAD6

public static final int KEY_NUMPAD6
See Also:
Constant Field Values

KEY_NUMPAD7

public static final int KEY_NUMPAD7
See Also:
Constant Field Values

KEY_NUMPAD8

public static final int KEY_NUMPAD8
See Also:
Constant Field Values

KEY_NUMPAD9

public static final int KEY_NUMPAD9
See Also:
Constant Field Values

KEY_MULTIPLY

public static final int KEY_MULTIPLY
See Also:
Constant Field Values

KEY_ADD

public static final int KEY_ADD
See Also:
Constant Field Values

KEY_SEPARATOR

public static final int KEY_SEPARATOR
See Also:
Constant Field Values

KEY_SUBTRACT

public static final int KEY_SUBTRACT
See Also:
Constant Field Values

KEY_DECIMAL

public static final int KEY_DECIMAL
See Also:
Constant Field Values

KEY_DIVIDE

public static final int KEY_DIVIDE
See Also:
Constant Field Values

KEY_F1

public static final int KEY_F1
See Also:
Constant Field Values

KEY_F2

public static final int KEY_F2
See Also:
Constant Field Values

KEY_F3

public static final int KEY_F3
See Also:
Constant Field Values

KEY_F4

public static final int KEY_F4
See Also:
Constant Field Values

KEY_F5

public static final int KEY_F5
See Also:
Constant Field Values

KEY_F6

public static final int KEY_F6
See Also:
Constant Field Values

KEY_F7

public static final int KEY_F7
See Also:
Constant Field Values

KEY_F8

public static final int KEY_F8
See Also:
Constant Field Values

KEY_F9

public static final int KEY_F9
See Also:
Constant Field Values

KEY_F10

public static final int KEY_F10
See Also:
Constant Field Values

KEY_F11

public static final int KEY_F11
See Also:
Constant Field Values

KEY_F12

public static final int KEY_F12
See Also:
Constant Field Values

KEY_F13

public static final int KEY_F13
See Also:
Constant Field Values

KEY_F14

public static final int KEY_F14
See Also:
Constant Field Values

KEY_F15

public static final int KEY_F15
See Also:
Constant Field Values

KEY_F16

public static final int KEY_F16
See Also:
Constant Field Values

KEY_F17

public static final int KEY_F17
See Also:
Constant Field Values

KEY_F18

public static final int KEY_F18
See Also:
Constant Field Values

KEY_F19

public static final int KEY_F19
See Also:
Constant Field Values

KEY_F20

public static final int KEY_F20
See Also:
Constant Field Values

KEY_F21

public static final int KEY_F21
See Also:
Constant Field Values

KEY_F22

public static final int KEY_F22
See Also:
Constant Field Values

KEY_F23

public static final int KEY_F23
See Also:
Constant Field Values

KEY_F24

public static final int KEY_F24
See Also:
Constant Field Values

KEY_NUM_LOCK

public static final int KEY_NUM_LOCK
See Also:
Constant Field Values

KEY_SCROLL_LOCK

public static final int KEY_SCROLL_LOCK
See Also:
Constant Field Values

KEY_LEFT_SHIFT

public static final int KEY_LEFT_SHIFT
See Also:
Constant Field Values

KEY_RIGHT_SHIFT

public static final int KEY_RIGHT_SHIFT
See Also:
Constant Field Values

KEY_LEFT_CONTROL

public static final int KEY_LEFT_CONTROL
See Also:
Constant Field Values

KEY_RIGHT_CONTROL

public static final int KEY_RIGHT_CONTROL
See Also:
Constant Field Values

KEY_LEFT_ALT

public static final int KEY_LEFT_ALT
See Also:
Constant Field Values

KEY_RIGHT_ALT

public static final int KEY_RIGHT_ALT
See Also:
Constant Field Values

KEY_SEMICOLON

public static final int KEY_SEMICOLON
See Also:
Constant Field Values

KEY_EQUALS

public static final int KEY_EQUALS
See Also:
Constant Field Values

KEY_COMMA

public static final int KEY_COMMA
See Also:
Constant Field Values

KEY_MINUS

public static final int KEY_MINUS
See Also:
Constant Field Values

KEY_PERIOD

public static final int KEY_PERIOD
See Also:
Constant Field Values

KEY_SLASH

public static final int KEY_SLASH
See Also:
Constant Field Values

KEY_BACK_QUOTE

public static final int KEY_BACK_QUOTE
See Also:
Constant Field Values

KEY_OPEN_BRACKET

public static final int KEY_OPEN_BRACKET
See Also:
Constant Field Values

KEY_BACK_SLASH

public static final int KEY_BACK_SLASH
See Also:
Constant Field Values

KEY_CLOSE_BRACKET

public static final int KEY_CLOSE_BRACKET
See Also:
Constant Field Values

KEY_QUOTE

public static final int KEY_QUOTE
See Also:
Constant Field Values

KEY_DOUBLE_MOUSE_BUTTON_1

public static final int KEY_DOUBLE_MOUSE_BUTTON_1
See Also:
Constant Field Values

KEY_DOUBLE_MOUSE_BUTTON_2

public static final int KEY_DOUBLE_MOUSE_BUTTON_2
See Also:
Constant Field Values

KEY_DOUBLE_MOUSE_BUTTON_3

public static final int KEY_DOUBLE_MOUSE_BUTTON_3
See Also:
Constant Field Values

KEY_TRIPLE_MOUSE_BUTTON_1

public static final int KEY_TRIPLE_MOUSE_BUTTON_1
See Also:
Constant Field Values

KEY_TRIPLE_MOUSE_BUTTON_2

public static final int KEY_TRIPLE_MOUSE_BUTTON_2
See Also:
Constant Field Values

KEY_TRIPLE_MOUSE_BUTTON_3

public static final int KEY_TRIPLE_MOUSE_BUTTON_3
See Also:
Constant Field Values

KEY_LEFT_META

public static final int KEY_LEFT_META
See Also:
Constant Field Values

KEY_RIGHT_META

public static final int KEY_RIGHT_META
See Also:
Constant Field Values

NUM_KEY_CODES

public static final int NUM_KEY_CODES
See Also:
Constant Field Values
Method Detail

setCursor

public static void setCursor(int cursorCode)
Sets the cursor type.


getCursor

public static int getCursor()

requestKeyboardFocus

public static void requestKeyboardFocus()

hasKeyboardFocus

public static boolean hasKeyboardFocus()

getState

public static int getState(int keyCode)
Returns:
the key code state (UP, PRESSED, DOWN, or RELEASED) since the last call to poll. Returns UP if the key code is not defined.

isMouseInside

public static boolean isMouseInside()
Returns true if the mouse is inside the Stage.


isMouseMoving

public static boolean isMouseMoving()
Returns:
true if the mouse moved since the last frame.

getMouseX

public static int getMouseX()
Returns:
the current x location of the mouse.

getMouseY

public static int getMouseY()
Returns:
the current y location of the mouse.

getMousePressX

public static int getMousePressX()
Gets the x location of the last mouse press. To check if the mouse was just pressed, use isMousePressed().

Returns:
the x location of the last mouse press.

getMousePressY

public static int getMousePressY()
Gets the y location of the last mouse press. To check if the mouse was just pressed, use isMousePressed().

Returns:
the y location of the last mouse press.

getMouseReleaseX

public static int getMouseReleaseX()
Gets the x location of the last mouse release. To check if the mouse was just relesaed, use isMouseReleased().

Returns:
the x location of the last mouse release.

getMouseReleaseY

public static int getMouseReleaseY()
Gets the y location of the last mouse release. To check if the mouse was just relesaed, use isMouseReleased().

Returns:
the y location of the last mouse release.

getMouseWheelX

public static int getMouseWheelX()
Gets the x location of the last mouse wheel rotation. To check if the mouse wheel was just rotated, use getMouseWheelRotation().

Returns:
the x location of the last mouse wheel rotation.

getMouseWheelY

public static int getMouseWheelY()
Gets the y location of the last mouse wheel rotation. To check if the mouse wheel was just rotated, use getMouseWheelRotation().

Returns:
the y location of the last mouse wheel rotation.

getMouseWheelRotation

public static int getMouseWheelRotation()
Returns the number of clicks the mouse wheel was rotated since the last poll.

For applets, mouse wheel input may not work all situations. For example, the applet must first have focus, and some browsers (notably, Safari on Mac OS X) will not allow mouse wheel input at all.

Returns:
negative values if the mouse wheel was rotated up (away from the user), and positive values if the mouse wheel was rotated down (toward the user).
See Also:
getMouseWheelX(), getMouseWheelY()

getTypedChars

public static String getTypedChars()
Returns the keyboard character input received since the last poll.


isDown

public static boolean isDown(int keyCode)
Returns:
true if the key with the specified key code is currently down or was pressed since the last call to poll().

isPressed

public static boolean isPressed(int keyCode)
Returns:
true if the key with the specified key code has been pressed since the last call to poll(). After the next call to poll(), if the key is still down, this returns false and isDown() returns true.

isTyped

public static boolean isTyped(int keyCode)

isReleased

public static boolean isReleased(int keyCode)
Returns:
true if the key with the specified key code has been released since the last call to poll(). After the next call to poll(), isDown() returns false (unless the key is pressed again).

isPressed

public static boolean isPressed(int[] keyCodes)
Checks a list of key codes and returns true if at least one key is pressed and no other keys are down. This is a convenience method to bind an action to zero or more keys. For example, the arrow keys and the WASD keys could be bound to the same action.

Returns:
true if at least one key is pressed and no other keys are down.

isDown

public static boolean isDown(int[] keyCodes)
Checks a list of key codes and returns true if at least one key is down. This is a convenience method to bind an action to zero or more keys. For example, the arrow keys and the WASD keys could be bound to the same action.

Returns:
true if any key is down.

isReleased

public static boolean isReleased(int[] keyCodes)
Checks a list of key codes and returns true if at least one key is released and no other keys are down. This is a convenience method to bind an action to zero or more keys. For example, the arrow keys and the WASD keys could be bound to the same action.

Returns:
true if at least one key is released and no other keys are down.

isControlDown

public static boolean isControlDown()
Checks if either the left control (CTRL) key or the right control key is currently down.


isShiftDown

public static boolean isShiftDown()
Checks if either the left shift key or the right shift key is currently down.


isAltDown

public static boolean isAltDown()
Checks if either the left ALT key or the right ALT key is currently down.


isMetaDown

public static boolean isMetaDown()
Checks if either the left meta key or the right meta key is currently down. The meta key is the Command key on Mac OS X.


isMousePressed

public static boolean isMousePressed()
Returns true if the primary mouse button is pressed.

See Also:
getMousePressX(), getMousePressY()

isMouseReleased

public static boolean isMouseReleased()
Returns true if the primary mouse button is released.

See Also:
getMouseReleaseX(), getMouseReleaseY()

isMouseDown

public static boolean isMouseDown()
Returns true if the primary mouse button is down.

See Also:
getMouseX(), getMouseY()

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.