From f95a1a8039d678d899e4081c4e1211c2f1827aaf Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 9 Dec 2023 16:01:15 +0100 Subject: [PATCH] Streamline hotkeys --- src/Models/ThemeViewState.ts | 10 +--------- src/UI/Base/Hotkeys.ts | 3 +++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Models/ThemeViewState.ts b/src/Models/ThemeViewState.ts index 542d4ba58..7b9e69e71 100644 --- a/src/Models/ThemeViewState.ts +++ b/src/Models/ThemeViewState.ts @@ -503,14 +503,7 @@ export default class ThemeViewState implements SpecialVisualizationState { Translations.t.hotkeyDocumentation.selectItem, () => this.selectClosestAtCenter(0) ) - Hotkeys.RegisterHotkey( - { - nomod: "Spacebar", - onUp: true, - }, - Translations.t.hotkeyDocumentation.selectItem, - () => this.selectClosestAtCenter(0) - ) + for (let i = 1; i < 9; i++) { let doc = Translations.t.hotkeyDocumentation.selectItemI.Subs({ i }) if (i === 1) { @@ -531,7 +524,6 @@ export default class ThemeViewState implements SpecialVisualizationState { } return true // unregister }) - this.featureSwitches.featureSwitchBackgroundSelection.addCallbackAndRun((enable) => { if (!enable) { return diff --git a/src/UI/Base/Hotkeys.ts b/src/UI/Base/Hotkeys.ts index 379e97f68..e75694431 100644 --- a/src/UI/Base/Hotkeys.ts +++ b/src/UI/Base/Hotkeys.ts @@ -113,6 +113,9 @@ export default class Hotkeys { if (keycode.length == 1) { keycode = keycode.toUpperCase() } + if (keycode === " ") { + keycode = "Spacebar" + } modifiers.push(keycode) return <[string, string | Translation]>[modifiers.join("+"), documentation] })