Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
description: "Tasks for 096 custom keyboard shortcuts"
Tasks: Custom keyboard shortcuts
Input: Design documents from specs/096-custom-shortcuts/
Prerequisites: plan.md, spec.md, research.md, data-model.md, contracts/actions.md, contracts/ui-contract.md, quickstart.md
Tests: Smoke-test checks are part of the Nota PR gate (constitution IV), so the binding
logic gets KeyBindingTests in tests/Nota.SmokeTest/.
Organization: grouped by user story. Paths are repo-relative.
Format: [ID] [P?] [Story] Description
- [P]: can run in parallel (different files, no dependency on an incomplete task)
- [Story]: US1–US4 from spec.md
Phase 1: Setup
- T001 Add
KeyBindings(Dictionary<string, KeyBindingOverride>) and theKeyBindingOverride { string? Primary; string? Alternative; }class ("null = default, "" = unassigned, else glyph text") tosrc/managed/Nota.Application/Settings.cs
Phase 2: Foundational (blocking)
- T002 [P] Create
KeyScopeenum (Global, Arrangement, Notes, Session, PianoRoll, AudioEditor, Devices, Browser, Modular) withIsWindowLayer(Global | Arrangement | Notes) insrc/managed/Nota.Application/Input/KeyScope.cs - T003 [P] Create
KeyAction(Id, Title, Group, Scope, DefaultPrimary, DefaultAlternative, IsMenuCommand, NoMenuKey, Fixed, Aliases) insrc/managed/Nota.Application/Input/KeyAction.cs - T004 Create
KeyActionCatalog.Create()insrc/managed/Nota.Application/Input/KeyActionCatalog.cs: import everyCommandCatalogcommand (gesture → default, scope fromView/id per contracts/actions.md, roll.* → PianoRoll, session.insertScene → Session), give the shared actions their defaults (edit.copy ⌘C, edit.cut ⌘X, edit.paste ⌘V, edit.delete ⌫ + alt ⌦, NoMenuKey on copy/cut/paste/delete), addedit.cancel(Esc) and every (new) action of contracts/actions.md with per-platform defaults;file.exitFixed on macOS - T005 [P] Create per-platform
ReservedKeys(research R5) withReason(Shortcut, platform)insrc/managed/Nota.Application/Input/ReservedKeys.cs - T006 Create
KeyBindingsservice insrc/managed/Nota.Application/Input/KeyBindings.cs: load overrides from settings (skip unknown ids / unparsable glyphs with a log line), effective map,Current,IsEdited,Matches,Resolve(scope, chord),FindConflicts(rule R3 incl. default-default exemption),FindShadows,Validate(reserved / bare modifier), atomicApply(set + Replace),Reset,ResetAll,NeedsDecision,Changed, persist viaISettingsService - T007 [P] Create
KeyTokens(AvaloniaKey⇄ token, keypad digits → digit,FromKeyEvent(KeyEventArgs) → Shortcut?, platform modifier mapping) insrc/managed/Nota.App/Input/KeyTokens.cs; routeToGesturethrough it insrc/managed/Nota.App/Input/ShortcutAvaloniaExtensions.cs - T008 Create the app facade
Keys(Is(e, id),Resolve(e, scope),Capturing,Bindings) insrc/managed/Nota.App/Input/Keys.cs; register and loadKeyBindingsat startup (DI insrc/managed/Nota.App/App.axaml.csor whereISettingsServiceis created) - T009 [P] Add
KeyBindingTestsintests/Nota.SmokeTest/KeyBindingTests.cs(catalog ids unique, every catalog command present, defaults conflict-free under R3 except default pairs, round trip of overrides, unknown id / junk glyph skipped, reserved keys refused, Replace atomic, Reset rechecks, ResetAll, new-default collision → NeedsDecision) and register it intests/Nota.SmokeTest/Program.cs
Checkpoint: catalog and service exist, nothing in the UI uses them yet.
Phase 3: User Story 1 — Rebind a shortcut (P1) 🎯 MVP
Goal: every key handler asks the bindings; the Shortcuts page can capture, confirm, clear.
Independent test: rebind Split to ⌘T and piano-roll Transpose up to ⌘K, restart, both work; old keys don't.
- T010 [US1] Switch
src/managed/Nota.App/MainWindow.Input.cstoKeys.Is: palette toggle and Space / ⇧Space / Return in the tunnel handler (Session Return →session.launchSelection), Tab →view.cycleDetailTab, the Esc chain →edit.cancel, track keys → shared actions, ⌘⇧A, ⌘A, ⌘R, ⌘., ⌘⇧R, ⌘M, ⌘⇧M, ⌘G/⌘⇧G, ⌘⇧V, ⌘⇧C, ⌘⇧D/⌘⇧I, clipboard, nudge/move (arr.*), delete, 0, P, Z X C V (notes.*),GridCommandFor, theKeyToPitchmap →notes.*actions (KeyUp still releases by physical key); keep every gate and the order - T011 [P] [US1] Switch
src/managed/Nota.App/PianoRollView.csOnKeyDownandsrc/managed/Nota.App/PianoRollView.Controllers.cstoKeys.Is(roll.* actions, shared edit.*) - T012 [P] [US1] Switch
src/managed/Nota.App/SessionView.csHandleKey(session.rename, session.insertScene, edit.copyToOtherView, shared edit.*; selection arrows stay fixed) - T013 [P] [US1] Switch
src/managed/Nota.App/ModularView.cskey handler (modular.fit, modular.bypass, edit.duplicate, edit.delete, edit.cancel; Space pan stays fixed) - T014 [P] [US1] Switch
src/managed/Nota.App/DeviceChainView.Clipboard.cs(devices.group/ungroup, shared edit.*, edit.cancel) and the Esc paths of rack cards / audio clip editor reached from MainWindow - T015 [P] [US1] Switch
src/managed/Nota.App/BrowserView.Files.cs(browser.back/forward/up/editPath incl. off-macOS alternatives; Return stays fixed) - T016 [US1] Menu:
src/managed/Nota.App/MainWindow.MenuKeys.cstakes gestures fromKeyBindings(skip NoMenuKey), re-applies them and rebuilds_menuShortcutsonChanged;HandleFloatingKeyDownundo/redo/grid viaKeys.Is - T017 [US1] Replace
ShortcutGroupswith aShortcutLayout(groups ofAction(id)andFixed(key, text)rows; every catalog action exactly once, mouse/gamepad/navigation rows fixed) insrc/managed/Nota.App/PreferencesWindow.Shortcuts.cs; render action rows with key-cap buttons (primary + alternative slot) insrc/managed/Nota.App/PreferencesWindow.cs - T018 [US1] Capture mode in
src/managed/Nota.App/PreferencesWindow.Shortcuts.cs: one row at a time, tunnel KeyDown takes every key,Keys.Capturingset (MainWindow ignores keys; macOS menu gestures cleared and restored), proposed caps shown, Confirm / Cancel / Clear / Assign Esc, Esc cancels, window deactivation cancels - T019 [US1] Add EN strings for new action titles and editor UI to
src/managed/Nota.Application/Localization/en.json - T020 [US1] Update
tests/Nota.SmokeTest/PaletteTests.csRegistryDrift: every catalog action appears in the Shortcuts layout (instead of the glyph scan)
Checkpoint: US1 works end to end.
Phase 4: User Story 2 — Conflicts (P1)
Independent test: ⌘D for Transpose up → conflict names Duplicate → Replace; ⇧F for Nudge left → accepted with a note; ⌘Q refused.
- T021 [US2] Conflict line in capture (
FindConflicts: "⌘D is used by Duplicate (Global)", Replace / Cancel, Confirm hidden) and the shadow note (FindShadows) insrc/managed/Nota.App/PreferencesWindow.Shortcuts.cs - T022 [US2] Reserved / incomplete feedback (
Validate) in the capture field insrc/managed/Nota.App/PreferencesWindow.Shortcuts.cs
Phase 5: User Story 3 — Edited mark, filter, reset (P2)
Independent test: edit three, Edited only shows three; reset one; Reset all → none.
- T023 [US3] Edited mark (accent dot), "default ⌘E" caps, ↺ Reset per row (conflict check first) in
src/managed/Nota.App/PreferencesWindow.Shortcuts.cs - T024 [US3] Header: "Edited only" toggle, "Reset all to defaults…" with confirmation dialog, "Needs a decision" group; filter matches titles, aliases, group and current keys in glyph and spelled forms ("cmd t", "ctrl+t") in
src/managed/Nota.App/PreferencesWindow.Shortcuts.cs
Phase 6: User Story 4 — Note map (P3)
Independent test: notes.c → Q, Q plays C4; A doesn't.
- T025 [US4] Lay out the 13 note rows + octave / velocity rows in their own group; confirm Notes-scope conflicts against window-layer keys in
src/managed/Nota.App/PreferencesWindow.Shortcuts.cs
Phase 7: Polish & cross-cutting
- T026 [P] Tooltips (the snap chip's ⌘1–⌘5 line stays static text — follow-up with #60):
KeyTips.Set(control, text, id)swaps the default glyph for the current key and re-applies onChangedinsrc/managed/Nota.App/Input/Keys.cs; use it insrc/managed/Nota.App/MainWindow.MenuKeys.cs(record, loop record, metronome, maximize, automation) and the snap chip / loop tips - T027 [P] Palette hints: current key from
KeyBindingsinsrc/managed/Nota.Presentation/PaletteProviders.cs; refresh the index onChanged - T028 [P]
CHANGELOG.md[Unreleased]entry andFEATURES.md(nota-features skill) - T029 User docs (nota-daw/nota-docs#99): shortcuts page EN + RU in
../nota-docsand itsscripts/shortcuts.mjsreading the new layout (nota-docs skill; separate nota-docs PR) - T030
scripts/build.shgreen; walk quickstart.md in the app (macOS) withNOTA_DATA_DIR=/tmp/n096data, screenshots of the editor
Dependencies & order
- T001 → T002–T009 → US1 (T010–T020) → US2 / US3 / US4 (editor, any order) → Polish.
- T010–T015 touch different files and can run in parallel after T008.
- US2–US4 extend the same editor file, so run them in sequence.
Implementation strategy
MVP = Phases 1–3 (rebind works, defaults unchanged). Conflicts (US2) must land in the same PR before release — without them US1 can break keys. Then US3, US4, polish.