From 4dfb56c10935c1a3c8bdf2cb0ca88d140294d8b7 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 6 Jul 2020 11:29:31 +0100 Subject: [PATCH] Added basic keyboard shortcut manual --- openflexure_microscope/api/static/src/App.vue | 55 ++++++++++++++++++- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/api/static/src/App.vue b/openflexure_microscope/api/static/src/App.vue index ff6ab0e2..9e1a31c1 100644 --- a/openflexure_microscope/api/static/src/App.vue +++ b/openflexure_microscope/api/static/src/App.vue @@ -7,6 +7,26 @@
+ + { + console.log(this.keyboardManual); + this.toggleModalElement(this.$refs["keyboardManualModal"]); // Calls the mixin }); // Arrow keys @@ -209,6 +230,10 @@ export default { }, "keyup" ); + this.keyboardManual.push({ + shortcut: "←↑→↓", + description: "Move the microscope stage" + }); // Focus keys Mousetrap.bind("pageup", () => { @@ -217,16 +242,40 @@ export default { Mousetrap.bind("pagedown", () => { this.$root.$emit("globalMoveStepEvent", 0, 0, -1); }); + this.keyboardManual.push({ + shortcut: "pgup / pgdn", + description: "Move the microscope focus" + }); // Capture Mousetrap.bind("c", () => { this.$root.$emit("globalCaptureEvent"); }); + this.keyboardManual.push({ + shortcut: "c", + description: "Take a capture" + }); // Autofocus Mousetrap.bind("a", () => { this.$root.$emit("globalFastAutofocusEvent"); }); + this.keyboardManual.push({ + shortcut: "a", + description: "Fast autofocus" + }); + + // Increment/decrement tab + Mousetrap.bind("shift+down", () => { + this.$root.$emit("globalIncrementTab"); + }); + Mousetrap.bind("shift+up", () => { + this.$root.$emit("globalDecrementTab"); + }); + this.keyboardManual.push({ + shortcut: "shift+↑ / shift+↓", + description: "Switch tab" + }); // Re-run tour Mousetrap.bind("alt+t", () => {