space: deselect and quit current tool with escape key

This commit is contained in:
mntmn
2020-09-27 23:39:33 +02:00
parent d4407556ca
commit b3927e0646

View File

@@ -197,6 +197,7 @@ var SpacedeckSections = {
Mousetrap.bind('del', function(evt) { this.if_editable(function() {this.delete_selected_artifacts(evt);}) }.bind(this));
Mousetrap.bind('backspace', function(evt) { this.if_editable(function() {this.delete_selected_artifacts(evt);}) }.bind(this));
Mousetrap.bind('esc', function(evt) { this.deselect(); this.deactivate_tool(); }.bind(this));
Mousetrap.bind(['command+d', 'ctrl+d' ], function(evt) { evt.preventDefault(); evt.stopPropagation(); this.if_editable(function() {this.duplicate_selected_artifacts();}) }.bind(this));
Mousetrap.bind(['command+z', 'ctrl+z' ], function(evt) { this.if_editable(function() {this.undo();}) }.bind(this));
Mousetrap.bind(['command+shift+z','ctrl+shift+z'], function(evt) { this.if_editable(function() {this.redo();}) }.bind(this));
@@ -666,14 +667,6 @@ var SpacedeckSections = {
},100);
},
handle_section_keydown: function(evt) {
if (evt.keyCode == 67 && (evt.ctrlKey || evt.metaKey)) { // c key
this.prepare_clipboard();
this.prepare_clipboard_step2();
}
return true;
},
handle_onbeforecopy: function(evt) {
if (this.editing_artifact_id) return;
@@ -2554,6 +2547,10 @@ var SpacedeckSections = {
this.toolbar_artifacts_in = false;
},
deactivate_tool: function(evt) {
this.active_tool = "pointer";
},
start_adding_artifact: function(evt) {
evt = fixup_touches(evt);
},