Questions

Per-app keyboard shortcuts on a Mac

Download on the Mac App StoreInputConfig is completely free on the Mac App Store. You don't have to make an account, there are no subscriptions, and nothing is locked. Optimized for Apple silicon.

There are two ways. To change the shortcut for a menu command in one app, macOS does it on its own, in App Shortcuts. To have the same key do a different job depending on the app in front, so F13 cuts a clip in Final Cut Pro, reopens a tab in Safari, and opens Mission Control everywhere else, use InputConfig, the free app I make, whose presets switch themselves as you change apps.

On this page
  1. Change a menu shortcut in one app, with macOS
  2. Give the same key a different job in each app
  3. Set it up
  4. Pick keys that do nothing else
  5. If a key must stop doing its own job
  6. The short version
  7. Questions

Change a menu shortcut in one app, with macOS

  1. Open System Settings, Keyboard, Keyboard Shortcuts, then App Shortcuts.
  2. Press the plus button and choose the app, or All Applications.
  3. Type the menu command's name exactly as it appears in the menu, including any trailing three dots.
  4. Press the shortcut you want and choose Done.

This only reaches commands that are in a menu, and the key has to be a combination the app does not already use. For anything else, such as opening another app, a macro, typed text or media keys, you need an app.

Give the same key a different job in each app

In InputConfig a preset is a set of keys and what they do, and a preset can name the apps it belongs to. Only one preset runs at a time. With automatic switching on, the app in front decides which one:

KeyEverywhere presetFinal Cut Pro presetSafari preset
F13Mission ControlB (Blade)Shift Command T (reopen closed tab)
F14SpotlightM (add marker)Shift Command backslash (show all tabs)
F15Play / PausePlay / PausePlay / Pause

When you leave Final Cut Pro for an app with no preset of its own, the preset you had before comes back, so the Everywhere preset works as the fallback.

Set it up

  1. Install InputConfig and allow Accessibility access.
  2. In Settings, Advanced, turn on Switch presets when the front app changes. It is off until you do.
  3. Build the Everywhere preset: add rows, press Scan, press each key, and pick its output. Activate it.
  4. Right-click it in the sidebar, choose Duplicate, and rename the copy after the app.
  5. In the copy, change the rows that should differ. Keep the rows you want everywhere, because only one preset runs at a time.
  • You: Open Automation & Gaming Utilities in the copy, find Activate when these apps are in front, press plus and add the app.
  • InputConfig: Switches to the copy when that app comes to the front, and back when you leave.
  • Check: Switch between the app and another one, and press F13 in each: it does the job of that app's preset.
The Automation and Gaming Utilities section of a preset in InputConfig, with Final Cut Pro listed under Activate when these apps are in front.
Figure 1. The app list on a preset. When one of these apps comes to the front, this preset takes over.

If two presets list the same app, the first in sidebar order wins. Picking a preset by hand while you are in the app turns off the automatic return for that visit, so the switch never fights your choice.

Pick keys that do nothing else

InputConfig listens alongside macOS, so a key keeps its own job too, and every keyboard reports to it as one device. That makes letters a poor choice and spare keys a good one:

  • F13 to F19. See F13 to F19.
  • A held right-hand modifier. See right-hand modifiers.
  • Something that types nothing. Mouse side buttons, a MIDI pad, or a game controller.

Each row can also have a hold, a double-tap and a triple-tap action, so one key can carry four jobs per app.

If a key must stop doing its own job

InputConfig adds to keys and never removes their job, so for that, use another tool:

  • Karabiner-Elements. Can limit a key-to-key rule to certain apps with its frontmost application conditions, written as rules.
  • BetterTouchTool and Keyboard Maestro. Both paid, with per-app triggers and macro groups in a visual editor.

The short version

  • A menu command in one app. Use System Settings, Keyboard, Keyboard Shortcuts, App Shortcuts.
  • One key, a job per app. Use an InputConfig preset for each app, with automatic switching on.
  • The fallback. The preset you had before comes back when you leave.

Build the Everywhere preset first, then copy it for each app.

Questions

Can I have different keyboard shortcuts for different apps on a Mac?

Yes. For menu commands, System Settings, Keyboard, Keyboard Shortcuts, App Shortcuts sets a shortcut per app. For giving the same spare key a different job in each app, InputConfig presets switch themselves when the app comes to the front.

What happens when I switch to an app that has no preset?

The preset that was running before the automatic switch comes back. If nothing was running, InputConfig stops until you go back to an app that has one.

Does it work in full-screen apps and games?

Yes. The switch happens when the app becomes the front app, full screen or not.

Can I switch keyboard layouts per app?

That is a typing setting, not a shortcut. Look in System Settings, Keyboard, Text Input, Input Sources, where macOS can switch to a document's input source automatically.

Can one preset cover several apps?

Yes. Add as many apps as you like to one preset, for example Safari, Chrome and Firefox on one browser layout.

Download on the Mac App StoreOpen source on GitHub.

Updated