added keyboard key as comments

This commit is contained in:
TBD 2017-11-05 22:51:16 +02:00 committed by GitHub
parent 650288a2ed
commit d11cc1288e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,25 +9,25 @@ function Keyboard()
} }
switch (event.keyCode) { switch (event.keyCode) {
case 83 : dotgrid.draw_arc(event.shiftKey ? "1,1" : "0,1"); break; case 83 : dotgrid.draw_arc(event.shiftKey ? "1,1" : "0,1"); break; // 'S'
case 65 : dotgrid.draw_arc(event.shiftKey ? "1,0" : "0,0"); break; case 65 : dotgrid.draw_arc(event.shiftKey ? "1,0" : "0,0"); break; // 'a'
case 68 : dotgrid.draw_line(); break; case 68 : dotgrid.draw_line(); break; // 'd'
case 70 : dotgrid.draw_bezier(); break; case 70 : dotgrid.draw_bezier(); break; // 'f'
case 82 : dotgrid.draw_close(); break; case 82 : dotgrid.draw_close(); break; // 'r'
case 187 : dotgrid.mod_thickness(1); break; case 187 : dotgrid.mod_thickness(1); break; // '+'
case 189 : dotgrid.mod_thickness(-1); break; case 189 : dotgrid.mod_thickness(-1); break; // '-'
case 191 : dotgrid.mod_linecap(1); break; case 191 : dotgrid.mod_linecap(1); break; // '/'
case 81 : dotgrid.reset(); break; case 81 : dotgrid.reset(); break; // 'Q'
case 27 : dotgrid.reset(); break; case 27 : dotgrid.reset(); break; // 'ESC'
case 87 : dotgrid.erase(); break; case 87 : dotgrid.erase(); break; // 'W'
case 8 : dotgrid.erase(); break; case 8 : dotgrid.erase(); break; // 'Backspace'
case 69 : dotgrid.export(); break; case 69 : dotgrid.export(); break; // 'e'
case 38 : dotgrid.mod_move(0,-1); break; case 38 : dotgrid.mod_move(0,-1); break; // 'up'
case 40 : dotgrid.mod_move(0,1); break; case 40 : dotgrid.mod_move(0,1); break; // 'down'
case 37 : dotgrid.mod_move(1,0); break; case 37 : dotgrid.mod_move(1,0); break; // 'left'
case 39 : dotgrid.mod_move(-1,0); break; case 39 : dotgrid.mod_move(-1,0); break; // 'right'
} }
dotgrid.draw(); dotgrid.draw();
} }