Using fakeKeyboard.js to simulate Keyboard events #2

merged 2 commits into from Apr 3, 2012

2 participants


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.

Tamizhvendan S |


This is beautiful work, thank you! Accepting ASAP.

Thanks Scott :-)

@OdeToCode OdeToCode merged commit 0b511be into OdeToCode:master Apr 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment