From 6ab6d5884b715560f789a114cdb8e0d98d2e0940 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 29 Jun 2022 21:20:28 +1000 Subject: Add setting for disabling keyboard shortcuts Avoid showing the setting on touch devices --- src/lib.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib.ts') diff --git a/src/lib.ts b/src/lib.ts index b04dabf..0e5917f 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -4,7 +4,7 @@ import {TolNode} from './tol'; import {LayoutOptions} from './layout'; -import {getBreakpoint, getScrollBarWidth, isTouchDevice} from './util'; +import {getBreakpoint, getScrollBarWidth, onTouchDevice} from './util'; // For server requests const SERVER_URL = 'http://localhost:8000/cgi-bin/data.py' @@ -109,6 +109,7 @@ export type UiOptions = { tutorialSkip: boolean, disabledActions: Set, useDblClick: boolean, + disableShortcuts: boolean, }; // Option defaults export function getDefaultLytOpts(): LayoutOptions { @@ -168,7 +169,8 @@ export function getDefaultUiOpts(lytOpts: LayoutOptions): UiOptions { searchJumpMode: false, tutorialSkip: false, disabledActions: new Set() as Set, - useDblClick: isTouchDevice(), + useDblClick: onTouchDevice(), + disableShortcuts: false, }; } // Used in Settings.vue, and when saving to localStorage -- cgit v1.2.3