diff --git a/WHATS_NEW.md b/WHATS_NEW.md index 2899a8a81..bca2ab6d7 100644 --- a/WHATS_NEW.md +++ b/WHATS_NEW.md @@ -1,6 +1,10 @@ -### 🌴 August 2020 ☀️ +### 🎃 October 2020 🍂 ## Shortcut to reload mesh `Ctrl + Shift + LeftClick` on any visible segment in 2D/3D to reload its mesh after an edit. This helps avoid having to refresh Neuroglancer to see the new mesh. NOTE: You may need to do this more than once because Neuroglancer cannot know if the remeshing process has completed. +## Additional Keybind to Complete Annotation +`Backquote` key (under `ESC`) can be used to complete an annotation.* + +****This serves as an alternative control for when double clicking doesn't work.*** \ No newline at end of file diff --git a/src/neuroglancer/ui/default_input_event_bindings.ts b/src/neuroglancer/ui/default_input_event_bindings.ts index 4470d794c..0f03da44f 100644 --- a/src/neuroglancer/ui/default_input_event_bindings.ts +++ b/src/neuroglancer/ui/default_input_event_bindings.ts @@ -89,6 +89,7 @@ export function getDefaultRenderedDataPanelBindings() { 'at:dblclick0': 'select', 'at:control+mousedown0': 'annotate', 'at:control+dblclick0': 'complete-annotation', + 'at:backquote': 'complete-annotation-viakey', 'at:mousedown2': 'move-to-mouse-position', 'at:control+mousedown2': 'select-annotation', 'at:alt+mousedown0': 'move-annotation', diff --git a/src/neuroglancer/viewer.ts b/src/neuroglancer/viewer.ts index f0b6067ed..9f96080c0 100644 --- a/src/neuroglancer/viewer.ts +++ b/src/neuroglancer/viewer.ts @@ -762,7 +762,7 @@ export class Viewer extends RefCounted implements ViewerState { } }); - this.bindAction('complete-annotation', () => { + const actionCompleteAnnotation = (shortcut?: boolean) => { const selectedLayer = this.selectedLayer.layer; if (selectedLayer === undefined) { StatusMessage.showTemporaryMessage( @@ -775,8 +775,11 @@ export class Viewer extends RefCounted implements ViewerState { JSON.stringify(selectedLayer.name)}) does not have an active annotation tool.`); return; } - (userLayer.tool.value).complete(true); - }); + (userLayer.tool.value).complete(shortcut); + }; + + this.bindAction('complete-annotation-viakey', () => actionCompleteAnnotation()); + this.bindAction('complete-annotation', () => actionCompleteAnnotation(true)); this.bindAction('toggle-axis-lines', () => this.showAxisLines.toggle()); this.bindAction('toggle-scale-bar', () => this.showScaleBar.toggle());