Added the ability to check if a key is down #63

Merged
merged 2 commits into from Nov 10, 2012

Projects

None yet

3 participants

Contributor

When developing games, it's very common to test whether a key is down in a loop rather than relying on key events. This commit adds two methods that let you check to see if a key is down, isKeyPressed() and getPressedKeyCodes().

perezd commented Oct 28, 2012

+1 this is super handy.

Owner
madrobby commented Nov 6, 2012

This is great and I'd love to add it, but it lacks unit tests (see keymaster.html in the test folder!).

Contributor

Added unit tests. See if that works for you.
Note: I did NOT minify the code.

@madrobby madrobby merged commit bfbe4a6 into madrobby:master Nov 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment