Blog · · 5 min read

VS Code shortcut not working? How to find out which key binding wins

Why a Visual Studio Code keyboard shortcut does nothing, and how to find the cause with the built-in troubleshooting log, the keyboard shortcuts editor and keybindings.json.

VS Code has the best tools of any editor for this problem: it can tell you exactly what happened to a key press. Instead of guessing, start with the log, then go through the causes it points to.

Start here: the keyboard shortcuts troubleshooting log

The VS Code documentation describes a built-in log for this:

  1. Open the Command Palette with Ctrl+Shift+P.
  2. Run Developer: Toggle Keyboard Shortcuts Troubleshooting.
  3. Open the Output panel if it does not open by itself.
  4. Press the shortcut that does not work.

The log shows the key VS Code received and which binding, if any, it matched. You get one of three answers:

  • No key arrived at all, or a different key arrived: the problem is outside VS Code (sections 1 and 2).
  • The key arrived but no binding matched, or the when condition was false: the binding is missing or does not apply here (sections 3 and 4).
  • A different command ran: another binding won (section 4 and 5).

Run the same command again to turn the log off.

1. Another program or Windows took the keys

If the log shows nothing when you press the shortcut, VS Code never saw it. Something earlier in the chain took it: a tool with a system-wide shortcut, a screen recorder, a clipboard manager, a graphics driver panel, or Windows itself.

One Windows setting deserves its own check, because VS Code uses Ctrl+Shift so much: in Settings > Time & language > Typing > Advanced keyboard settings > Input language hot keys, Windows can switch the keyboard layout with Ctrl+Shift. If it does, Ctrl+Shift+P also switches your layout. Change the hotkey to Left Alt+Shift, or use Win+Space to switch.

Check: close tray programs one at a time, or try the same key in Notepad to see if anything else reacts.

2. Fn keys and the keyboard layout

  • Function keys: F5 (start debugging), F2 (rename symbol) and F12 (go to definition) are media keys on many laptops. Hold Fn, or turn on Fn Lock (often Fn+Esc).
  • Keyboard layout: many default shortcuts use punctuation, such as Ctrl+Slash to comment a line or Ctrl+Backtick for the terminal. Those keys sit in different places on non-US layouts, and some need AltGr, which is the same as Ctrl+Alt on many European layouts. VS Code shows every shortcut in its menus and in the shortcuts editor as it maps to your current layout, so read the key there, not on a US cheat sheet. In keybindings.json, Ctrl+K Ctrl+K opens the Define Keybinding control, which shows the keys VS Code detects when you press them, and the file highlights bindings written for a US layout that need different keys on yours.

The documentation also mentions a keyboard.dispatch setting for layout problems, but it applies to macOS and Linux, not to Windows.

3. keybindings.json has an error

Your own shortcuts live in keybindings.json. The VS Code docs name syntax errors in this file as the most common problem: a missing comma or bracket, and the whole file, with every custom shortcut in it, stops working.

Check: run Preferences: Open Keyboard Shortcuts (JSON) from the Command Palette. VS Code underlines errors in red and lists them in the Problems panel. Fix them and save.

4. Another binding wins

Two commands can share a key. VS Code then uses the binding that applies in the current context, according to its when clause, and later entries override earlier ones. An extension, a keymap or one of your own entries can take a key you expected to do something else.

Check: open the keyboard shortcuts editor with Ctrl+K Ctrl+S, find the command, right-click it and choose Show Same Keybindings. You see every command on that key and its when condition.

Fix: remove the binding you do not want (right-click > Remove Keybinding), or change it. A removal shows up in keybindings.json as an entry with a minus before the command.

Chords are a separate case. After Ctrl+K, VS Code waits for a second key and shows that in the status bar. If a shortcut such as Ctrl+K Z (Zen mode) does nothing, look at the status bar after the first key.

5. An extension or a keymap changed the keys

Keymap extensions bring the shortcuts of other editors, such as Visual Studio, Sublime Text or Vim, and they replace many defaults. Run Preferences: Keymaps to see which keymap extensions you have. Vim extensions in particular take most keys in normal mode by design.

Other extensions add their own bindings too. To find which one changes a key, VS Code has Help: Start Extension Bisect: it turns half of your extensions off, asks whether the problem is still there, and repeats until it finds the one responsible.

Settings Sync also syncs keyboard shortcuts. If a binding changed without you touching it, it may have come from another computer.

Where a radial menu helps, and where it does not

RadialDeck is the radial menu for Windows that we make. When VS Code is in front, the same hotkey opens a VS Code ring. The gallery has 11 VS Code actions: Command palette, Quick open, Format document, Comment, Find in files, Source control, Terminal, Sidebar, Settings, Debug and Zen mode.

Each slice sends the default VS Code shortcut, so it depends on the same things as your keyboard:

  • If your keymap or keybindings.json changed a key, the slice sends the default and gets your changed command. Edit the slice to send your key.
  • If another program or the layout hotkey takes the key, it takes the slice's key too. The troubleshooting log shows it the same way.
  • What it helps with: remembering. Chords such as Ctrl+K Z and rarely used commands are one flick away, and the ring sends the two keys of a chord in order.

All VS Code actions are on the VS Code page.

Quick checklist

  1. Run Developer: Toggle Keyboard Shortcuts Troubleshooting and press the key.
  2. Nothing in the log? Close tray tools; check the Ctrl+Shift layout hotkey.
  3. F-keys: Fn or Fn Lock.
  4. Errors in keybindings.json?
  5. Ctrl+K Ctrl+S, right-click > Show Same Keybindings.
  6. Help: Start Extension Bisect for extensions.

RadialDeck is free for two rings and has a 14-day trial of Pro, which adds a ring per program such as the VS Code ring. It is in the Microsoft Store.

Try it in RadialDeck

Free for two rings, with a 14-day trial of everything in Pro. Windows 10 and 11, from the Microsoft Store.

Get it from Microsoft or download the installer (.exe)