From 6ab6d5884b715560f789a114cdb8e0d98d2e0940 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Wed, 29 Jun 2022 21:20:28 +1000
Subject: Add setting for disabling keyboard shortcuts

Avoid showing the setting on touch devices
---
 src/App.vue | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

(limited to 'src/App.vue')

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
-- 
cgit v1.2.3

