Add keyboard shortcuts for 'run' and 'stop'

- Fixes #16.
This commit is contained in:
Jen Kagan 2016-09-14 00:10:01 -04:00
parent 9e6d4b56bd
commit d55fb643e6

View file

@ -123,6 +123,14 @@ class IDEView extends React.Component {
e.preventDefault();
e.stopPropagation();
this.props.saveProject();
} else if (e.key === 'Enter' && e.shiftKey && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) {
e.preventDefault();
e.stopPropagation();
this.props.stopSketch();
} else if (e.key === 'Enter' && ((e.metaKey && this.isMac) || (e.ctrlKey && !this.isMac))) {
e.preventDefault();
e.stopPropagation();
this.props.startSketch();
}
}