keyboard shortcuts

This commit is contained in:
Rick Companje 2018-03-19 00:22:16 +01:00 committed by Casper Lamboo
parent d98b90bb2e
commit 7360cdc85a
1 changed files with 23 additions and 0 deletions

View File

@ -152,6 +152,29 @@ class App extends React.Component {
}
break;
case 's': {
if (!commandKey) d2ChangeTool(d2Tools.TRANSFORM);
break;
}
case 'e': {
if (!commandKey) {
event.preventDefault();
d2ChangeTool(d2Tools.ERASER);
}
break;
}
case 'c': {
if (!commandKey) d2ChangeTool(d2Tools.CIRCLE);
break;
}
case 'l': {
if (!commandKey) d2ChangeTool(d2Tools.POLYGON);
break;
}
case 't': {
if (!commandKey) d2ChangeTool(d2Tools.TEXT);
break;