diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-06-29 21:20:28 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-06-29 21:28:49 +1000 |
| commit | 6ab6d5884b715560f789a114cdb8e0d98d2e0940 (patch) | |
| tree | 9d6ce18cd33ccec2ae32521b9dc50533700cf1e9 /src/App.vue | |
| parent | e4c2de4f953e34f5f5e27f6574943770090b4ce0 (diff) | |
Add setting for disabling keyboard shortcuts
Avoid showing the setting on touch devices
Diffstat (limited to 'src/App.vue')
| -rw-r--r-- | src/App.vue | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/App.vue b/src/App.vue index 0961c7a..4744904 100644 --- a/src/App.vue +++ b/src/App.vue @@ -185,6 +185,7 @@ export default defineComponent({ return { color: this.uiOpts.textColor, backgroundColor: this.uiOpts.altColorDark, + aspectRatio: '1/1', }; }, tutPaneContainerStyles(): Record<string,string> { @@ -783,17 +784,18 @@ export default defineComponent({ } }, onKeyUp(evt: KeyboardEvent): void { + if (this.uiOpts.disableShortcuts){ + return; + } if (evt.key == 'Escape'){ this.resetMode(); } else if (evt.key == 'f' && evt.ctrlKey){ - // If no non-search modal is open, open/focus search bar - if (this.infoModalNodeName == null && !this.helpOpen && !this.settingsOpen){ - evt.preventDefault(); - if (!this.searchOpen){ - this.onSearchIconClick(); - } else { - (this.$refs.searchModal as InstanceType<typeof SearchModal>).focusInput(); - } + evt.preventDefault(); + // Open/focus search bar + if (!this.searchOpen){ + this.onSearchIconClick(); + } else { + (this.$refs.searchModal as InstanceType<typeof SearchModal>).focusInput(); } } else if (evt.key == 'F' && evt.ctrlKey){ // If search bar is open, switch search mode |
