2016-12-31 12:37:10 -05:00
|
|
|
function Keyboard()
|
|
|
|
{
|
|
|
|
this.listen = function(event)
|
|
|
|
{
|
2016-12-31 15:47:40 -05:00
|
|
|
console.log(event.keyCode);
|
2016-12-31 12:56:25 -05:00
|
|
|
switch (event.keyCode) {
|
2016-12-31 13:16:00 -05:00
|
|
|
case 65 : dotgrid.draw_arc(event.shiftKey ? "1,1" : "0,1"); break;
|
|
|
|
case 83 : dotgrid.draw_arc(event.shiftKey ? "1,0" : "0,0"); break;
|
2016-12-31 12:37:10 -05:00
|
|
|
case 68 : dotgrid.draw_line(); break;
|
|
|
|
case 70 : dotgrid.reset(); break;
|
2016-12-31 12:47:37 -05:00
|
|
|
case 71 : dotgrid.erase(); break;
|
2016-12-31 15:47:40 -05:00
|
|
|
case 81 : dotgrid.export(); break;
|
2016-12-31 12:37:10 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|