MainspringGuides › IDE debug keys
macOS Guide

Make F-keys work for IDE debug shortcuts on Mac

Updated July 2026 · 3 min read

You set a breakpoint, hit F5 to run the debugger — and your keyboard backlight dims instead. On a Mac, the top row triggers hardware controls by default, so F5, F9, and F10 never reach your IDE. Turn on Use F1, F2, etc. keys as standard function keys and those keys start driving the debugger the way the shortcut cheat-sheet promises.

Why debug keys feel broken

Debuggers lean on the F-row because it's fast and consistent across languages: in VS Code, F5 starts or continues, F9 toggles a breakpoint, F10 steps over, F11 steps into. IntelliJ and the other JetBrains IDEs, plus Xcode's own debugging, all map similar actions to those keys. The trouble is that macOS, by default, hands the top row to brightness, volume, and Mission Control — so the keystroke gets swallowed by the system before your editor ever sees it.

You could hold Fn every time to force the real F-key through, but during a debugging session you're pressing these keys constantly. Reaching for a modifier on every step-over gets old within minutes. Making F-keys the default press fixes it once.

Enable standard function keys

  1. Open System Settings → Keyboard.
  2. Click Keyboard Shortcuts….
  3. Select Function Keys in the sidebar.
  4. Turn on Use F1, F2, etc. keys as standard function keys.

The change is instant and identical on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia. Now F5 sends F5 straight to your IDE. Set a breakpoint, hit F5, and the debugger launches; F10 walks you line by line without a single trip to the trackpad.

You still have brightness and volume

Flipping this doesn't cost you the media controls — it just moves them behind the Fn key, which always does the opposite of the current setting:

Watch for shortcut collisions on the macOS side: F11 defaults to Show Desktop and F3 to Mission Control. If a debug key still doesn't land in your editor, check System Settings → Keyboard → Keyboard Shortcuts… and disable the conflicting system shortcut so the F-key passes through.

Set it from Terminal

Handy when you're configuring a new dev machine. The setting is one global default:

# F1-F12 send function keys by default
defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true

To revert to media keys as the default, write false or delete the key:

# Undo
defaults write NSGlobalDomain com.apple.keyboard.fnState -bool false
# or clear it
defaults delete NSGlobalDomain com.apple.keyboard.fnState

The System Settings toggle takes effect immediately; the Terminal route may need a log out and back in (or a restart) before it registers.

One switch for your dev setup

Mainspring exposes standard function keys as a labelled toggle, so your F-row is debugger-ready in a click and reversible whenever you want media keys back. It's one of 90+ hidden macOS settings it surfaces.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

Free up more keys for shortcuts

Once the F-row is yours, you can push key remapping further. See how to create custom keyboard shortcuts on Mac to bind app-specific actions to any key combination.