feat(quicknav): Phase 1 — core infrastructure #320
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement the core infrastructure for the QuickNav keyboard navigation addon. This phase delivers a working numbered-key command execution system with hardcoded workbench/grouping maps.
Scope
Event filter (
quicknav/event_filter.py)QuickNavEventFilter(QObject)installed on FreeCAD's main window viainstallEventFilter()KeyPressevents only when QuickNav is active0toggles on/off,1-9executes commands,Shift+1-9switches grouping,Ctrl+1-9switches workbenchQLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QDoubleSpinBox, or task panel input fieldsManager singleton (
quicknav/core.py)QuickNavManagersingleton orchestrating state: active flag, current workbench, current grouping, event filter lifecycleinstall()/uninstall()methods for event filter and nav bartoggle_active()bound to0keyswitch_workbench(n),switch_grouping(n),execute_command(n)dispatch methodsNavigation bar (
quicknav/nav_bar.py)QToolBarsubclass positioned at bottom of main windowHardcoded workbench map (
quicknav/workbench_map.py)Ctrl+Nassignments: Sketcher (1), Part Design (2), Assembly (3), Spreadsheet (4), TechDraw (5)Addon scaffold
mods/quicknav/package.xmlwith<kindred>extensions (priority 10, depends on sdk)Init.py(no-op),InitGui.py(registersQuickNavWorkbench)QuickNavWorkbenchclass: installs QuickNav on load, re-activates previous workbenchEnabledstateFreeCAD command registration
QuickNav_Togglecommand registered viaGui.addCommand()Deliverable
Working keyboard navigation:
0to toggle,1-9to run commands,Shift+1-9to switch groupings,Ctrl+1-5to switch workbenches. Navigation bar visible at bottom of window.References
docs/src/quicknav/SPEC.md— §3 (Key Bindings), §4 (Navigation Bar), §5 (Workbench Command Groupings), §8 (Key Event Handling), §9 (Addon Structure)