Summary
Maintain a catalog of well-known applications (keyed by bundle ID) with default per-pedal key mappings, so that when a user adds a known app in Settings, Footswitch can pre-populate the likely keystrokes for pedal 1 / 2 / 3 instead of leaving them blank. The user is always free to change the suggested defaults — this just removes guesswork for common apps.
The authoritative list of apps, bundle IDs, and key mappings is maintained in this Google Sheet:
https://docs.google.com/spreadsheets/d/1X3lw61pKETU-l1mG2y4ijKo3qt-JOSduF3AdS0lWHNQ/edit
Motivation
Today, adding an app to the rules table (config.rules, see Sources/FootswitchCore/Models/Rule.swift) gives the user an empty SlotActions that they must fill in by hand. For many well-known apps the "right" keystrokes are known and stable (e.g. mute/unmute, next/previous page/slide). Pre-supplying those defaults saves the user from looking up and entering each combo.
Pedal count is independent of the catalog: a single-switch pedal will only ever fire slot 1, so the slot 2/3 defaults are simply unused. But for apps that have distinct actions (separate mute vs. unmute, next vs. prev, as opposed to a single toggle key) we will already know how to populate slots 2 and 3.
Proposed Approach
- Add a bundled, read-only catalog of
{ bundleID, appName, slots: { 1, 2, 3 } } entries derived from the Google Sheet (e.g. a JSON resource shipped in the app bundle, generated/exported from the sheet).
- When the user adds an app in Settings:
- If the chosen app's bundle ID matches a catalog entry, pre-fill the per-slot actions from the catalog as the new rule's defaults.
- If there is no match, behave as today (empty slots).
- Pre-filled values are editable — the catalog only seeds initial defaults; it never overrides a user's saved choice.
- Catalog entries should map cleanly onto the existing
Action model (keyCombo for the common case; the schema should also be able to express slots that have no sensible default).
Open Questions / Decisions
Acceptance Criteria
Relevant Code
Sources/FootswitchCore/Models/Rule.swift — Rule { match, appName, slots }
Sources/FootswitchCore/Models/SlotActions.swift — per-slot Action map
Sources/FootswitchCore/Models/Action.swift — keyCombo / dictation / shortcut
Sources/FootswitchCore/RuleResolver.swift — exact bundle-ID matching
Sources/Footswitch/SettingsView.swift — where apps are added to the rules table
Summary
Maintain a catalog of well-known applications (keyed by bundle ID) with default per-pedal key mappings, so that when a user adds a known app in Settings, Footswitch can pre-populate the likely keystrokes for pedal 1 / 2 / 3 instead of leaving them blank. The user is always free to change the suggested defaults — this just removes guesswork for common apps.
The authoritative list of apps, bundle IDs, and key mappings is maintained in this Google Sheet:
https://docs.google.com/spreadsheets/d/1X3lw61pKETU-l1mG2y4ijKo3qt-JOSduF3AdS0lWHNQ/edit
Motivation
Today, adding an app to the rules table (
config.rules, seeSources/FootswitchCore/Models/Rule.swift) gives the user an emptySlotActionsthat they must fill in by hand. For many well-known apps the "right" keystrokes are known and stable (e.g. mute/unmute, next/previous page/slide). Pre-supplying those defaults saves the user from looking up and entering each combo.Pedal count is independent of the catalog: a single-switch pedal will only ever fire slot 1, so the slot 2/3 defaults are simply unused. But for apps that have distinct actions (separate mute vs. unmute, next vs. prev, as opposed to a single toggle key) we will already know how to populate slots 2 and 3.
Proposed Approach
{ bundleID, appName, slots: { 1, 2, 3 } }entries derived from the Google Sheet (e.g. a JSON resource shipped in the app bundle, generated/exported from the sheet).Actionmodel (keyCombofor the common case; the schema should also be able to express slots that have no sensible default).Open Questions / Decisions
RuleResolver), so this stays a pure convenience layer over the existing matching.Acceptance Criteria
Relevant Code
Sources/FootswitchCore/Models/Rule.swift—Rule { match, appName, slots }Sources/FootswitchCore/Models/SlotActions.swift— per-slotActionmapSources/FootswitchCore/Models/Action.swift—keyCombo/dictation/shortcutSources/FootswitchCore/RuleResolver.swift— exact bundle-ID matchingSources/Footswitch/SettingsView.swift— where apps are added to the rules table