Closed davidbau closed 10 years ago
I'm preparing this change to make it easier to make keyboard-based games.
You can poll the left-arrow-key (for example) by testing
if pressed 'left' then write 'Left is pressed'
API looks nice. Please let me know if you get this in before class.
OK, I've updated based on your changes, and i'm merging to master. Thanks for the code review!
Usage:
if pressed 'A' then write 'the A key is pressed.' if pressed 'control' then write 'the Control key is pressed.' write 'All pressed keys: ' + pressed.list().join(',')
It handles chording and resets tracked state when focus is lost.