From 0bb55e82ab9cd8f8a426bc47351fb064e5555998 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 29 Apr 2025 22:47:12 +0200 Subject: [PATCH] UX: add hotkey to open new point dialog --- src/Models/ThemeViewState/WithLayoutSourceState.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Models/ThemeViewState/WithLayoutSourceState.ts b/src/Models/ThemeViewState/WithLayoutSourceState.ts index 552686f27..ecfacb711 100644 --- a/src/Models/ThemeViewState/WithLayoutSourceState.ts +++ b/src/Models/ThemeViewState/WithLayoutSourceState.ts @@ -7,6 +7,8 @@ import LayerState from "../../Logic/State/LayerState" import { Store } from "../../Logic/UIEventSource" import { FeatureSource, IndexedFeatureSource } from "../../Logic/FeatureSource/FeatureSource" import { Tag } from "../../Logic/Tags/Tag" +import Hotkeys from "../../UI/Base/Hotkeys" +import Translations from "../../UI/i18n/Translations" export class WithLayoutSourceState extends WithSelectedElementState { readonly layerState: LayerState @@ -50,6 +52,15 @@ export class WithLayoutSourceState extends WithSelectedElementState { this.floors = WithLayoutSourceState.initFloors(this.featuresInView) this.initFilters() + + Hotkeys.RegisterHotkey( + { nomod: "n" }, + Translations.t.hotkeyDocumentation.addNew, + () => { + this.openNewDialog() + } + ) + } /** @@ -121,4 +132,5 @@ export class WithLayoutSourceState extends WithSelectedElementState { this.featureProperties.trackFeature(feature) this.selectedElement.setData(feature) } + }