Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Controls Class

When the user interacts with the game, for example using the keyboard or mouse, these interactions are recorded. You can get the mouse position, or the state of mouse and keyboard keys, using this class.

All of the Control objects are internally tied to the state of the keyboard and mouse. So you can use the same controls object, across multiple frames.

Available Keys

new

isLeftDown

isRightDown

isMiddleDown

isLeftClick

isRightClick

isMiddleClick

isLeftPressed

isRightPressed

isMiddlePressed

getMouseX

getMouseY

getMouseXY

getMouseAngle

isKeyPressed

isKeyDown

isKeyReleased

getKeysPressed

getKeysDown

getKeysReleased

See Also