OdeToCode/p5 — pull request #2 by tamizhvendan (2012-04-02 13:11:38+00:00)
Title: Using fakeKeyboard.js to simulate Keyboard events

Hi Scott,

I am using your p5 as a Kata to improve my javascript skills.

While playing with p5, I've found, that you are using the function $(window).trigger(key()) to simulate the keyboard events in the Qunit tests.

IMHO, its bit verbose, and the trigger function and keydown event function is duplicated for each key press.

So, I've refactored the keyboard simulation to a separate "fakeKeyboard.js" file and it resulted in a cleaner way (In my perspective) to do the same via functions like "fakeKeyboard.pressRightArrow(keyPressCount)".

I've just done this for my learning purpose. Kindly accept this pull request, if it make sense and appropriate to you.

Thanks,
Tamizhvendan S | http://sweettam.blogspot.com