Added shortcuts

This commit is contained in:
Devine Lu Linvega
2016-12-31 10:37:10 -07:00
parent 452bcd0d41
commit 2b964af3af
5 changed files with 90 additions and 33 deletions

16
scripts/keyboard.js Normal file
View File

@@ -0,0 +1,16 @@
function Keyboard()
{
this.listen = function(event)
{
console.log(dotgrid);
console.log(event.keyCode);
switch (event.key || event.keyCode) {
case 65 : dotgrid.draw_arc_a(); break;
case 83 : dotgrid.draw_arc_c(); break;
case 68 : dotgrid.draw_line(); break;
case 70 : dotgrid.reset(); break;
}
}
}