Added shortcuts
This commit is contained in:
16
scripts/keyboard.js
Normal file
16
scripts/keyboard.js
Normal 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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user