pointvec/scripts/keyboard.js

20 lines
534 B
JavaScript
Raw Normal View History

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;
2016-12-31 15:55:35 -05:00
case 81 : dotgrid.reset(); break;
case 87 : dotgrid.erase(); break;
case 80 : dotgrid.export(); break;
2017-01-04 12:48:08 -05:00
case 90 : dotgrid.draw_dot(); break;
case 88 : dotgrid.draw_circle(); break;
2016-12-31 12:37:10 -05:00
}
}
}