[185] Navigation wie Archicad: Geschosswechsel behält Zoom, Cmd+5/6 Geschoss, Cmd+3/4 Auswahl im 3D
Grundriss: Geschosse teilen den Einpass-Schlüssel (planFitKey, PlanView fitKey), Wechsel behält Ausschnitt und Massstab exakt. Cmd/Ctrl+5/6 Geschoss tiefer/höher im Grundriss- und 3D-Reiter. Cmd/Ctrl+3 zeigt nur die Auswahl im 3D (Reiter „3D · Auswahl“, Kamera passt ein; ohne Auswahl alles), Cmd/Ctrl+4 blendet die Auswahl im 3D aus. Zustand rein UI (state/view3dFilter.ts). Kern: model3d::ElementSelection im ClassFilter (only/hideIds für Teile, Cache, Pick). Kürzel umbelegbar, natives Menü Ansicht. PlanViewHandle.pxPerMeter liest die aktuelle viewBox.
This commit is contained in:
29 files changed
+717
-42
No files matched your search
@@ -32,6 +32,7 @@ import {
|
||||
import type { ElementClipboard, ElementSelectionIds, PastedIds } from "../editors/elementClipboard";
|
||||
import { parseClipboardText, serializeClipboardText } from "../editors/elementClipboardSerialize";
|
||||
import { matchesShortcut, type ShortcutId, type ShortcutOverrides } from "./keyboardShortcuts";
|
||||
import { hideSelectionIn3d, showSelectionIn3d, stepActiveFloor } from "./tabNavigation";
|
||||
|
||||
const isEditableTarget = (e: KeyboardEvent): boolean => {
|
||||
const el = e.target as HTMLElement | null;
|
||||
@@ -643,3 +644,31 @@ export function useGroupShortcut(
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currentSelection, selectedGroupIds, overrides]);
|
||||
}
|
||||
|
||||
/**
|
||||
* [185] Navigation wie Archicad: Cmd/Ctrl+5 Geschoss tiefer, Cmd/Ctrl+6 höher (Grundriss- und 3D-Reiter, Zoom
|
||||
* bleibt), Cmd/Ctrl+3 Auswahl in 3D zeigen (ohne Auswahl: alles), Cmd/Ctrl+4 Auswahl im 3D ausblenden. Unter Tauri
|
||||
* fängt das native Menü dieselben Kürzel ab (`native/appMenu.ts`).
|
||||
*/
|
||||
export function useViewNavigationShortcuts(overrides: ShortcutOverrides): void {
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
// Die (oft fokussierte) Befehlszeile tippt keine Cmd/Ctrl-Ziffern: dort gelten die Kürzel.
|
||||
if (isEditableTarget(e) && !(e.target as HTMLElement).classList.contains("cmdline-input")) return;
|
||||
const fn = matchesShortcut(e, "floorDown", overrides)
|
||||
? () => stepActiveFloor(-1)
|
||||
: matchesShortcut(e, "floorUp", overrides)
|
||||
? () => stepActiveFloor(1)
|
||||
: matchesShortcut(e, "showSelection3d", overrides)
|
||||
? showSelectionIn3d
|
||||
: matchesShortcut(e, "hideSelection3d", overrides)
|
||||
? hideSelectionIn3d
|
||||
: null;
|
||||
if (!fn) return;
|
||||
e.preventDefault();
|
||||
fn();
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [overrides]);
|
||||
}
|
||||
Reference in new issue
Block a user