VS Code's Ctrl+Click shortcut opens a code symbol's definition, while F12 opens the same definition without using the mouse.
On Windows and Linux, hold Ctrl and left-click a symbol such as a function, class, or variable. On macOS, hold Cmd instead. The modifier must remain down when the mouse click occurs; this is different from a chord such as Ctrl+K Ctrl+S, which requires two key combinations in sequence.
If the goal is to perform the Ctrl+Click navigation action with only the keyboard, the direct answer is F12. If Ctrl+Click does nothing while F12 still works, the problem is more likely a changed pointer binding, a context restriction, or an intercepted mouse modifier than a missing definition.

Ctrl+Click and other definition actions
VS Code provides several ways to inspect a symbol. These are standard defaults, although user keybindings, extensions, keyboard layouts, and context-specific rules can alter their behavior.
| Action | Windows and Linux | macOS | Result |
|---|---|---|---|
| Go to Definition | Ctrl+Click or F12 | Cmd+Click or F12 | Opens the definition of the symbol under the pointer or cursor. |
| Peek Definition | Alt+F12 | Option+F12 | Shows the definition in a peek view without leaving the current editor. |
| Show References | Shift+F12 | Shift+F12 | Lists locations that reference the selected symbol. |
Ctrl+Click is meaningful only where VS Code recognizes the target as a symbol with an available definition. Clicking a plain word, whitespace, an unresolved identifier, or content that the current language tooling does not interpret as a symbol may do nothing. Peek Definition is useful when you want to check an implementation without losing your current editing position.
These actions are related but not identical. A pointer gesture and F12 are separate inputs, even when they normally invoke the same Go to Definition command. That distinction makes them useful when diagnosing a broken shortcut.
Open a symbol definition
Use this workflow to navigate directly to a function, class, variable, or other recognized code symbol:
-
Open the source file in VS Code and locate the symbol you want to inspect. Make sure the pointer will rest directly over the identifier rather than over punctuation or surrounding text.
-
On Windows or Linux, hold down Ctrl and left-click the symbol. Keep Ctrl depressed until the mouse click completes. On macOS, hold down Cmd and click instead.
-
Release the mouse and modifier after clicking. VS Code should open the symbol's definition, either in the current file or in another source file.
-
If you prefer not to use the mouse, place the text cursor inside the symbol and press F12. This invokes the standard Go to Definition action without requiring Ctrl+Click.
-
If the definition does not appear, confirm that the location is actually a symbol and that the file's language support recognizes it. A valid symbol with no available definition can still have no navigation target.
-
If the symbol appears valid but Ctrl+Click fails, open the built-in Keyboard Shortcuts editor and search for Go to Definition. That reveals whether your active profile still assigns the expected gesture and whether a context condition is blocking it.
Platform modifiers and shortcut behavior
Windows and Linux normally use Ctrl+Click, while macOS normally uses Cmd+Click. Control+Click on macOS is not automatically interchangeable with Cmd+Click; it may be handled as a different modifier or context-menu gesture. On a Mac trackpad, hold the Command key while clicking.
A pointer shortcut and a chord are also different input patterns. Ctrl+Click combines a held modifier and a mouse click at the same time. By contrast, Ctrl+K Ctrl+S is a chord: press Ctrl+K, release that combination, and then press Ctrl+S. On macOS, the corresponding chord uses Cmd+K followed by Cmd+S.
VS Code renders key labels according to the active keyboard layout, while default shortcut references generally assume a standard US layout. If labels or behavior look unfamiliar, check the operating system's input configuration before assuming the command itself is missing. Microsoft's macOS keyboard shortcut reference provides the broader platform-specific list when you need commands beyond definition navigation.
Reasons the shortcut can stop working
Several layers can affect Ctrl+Click without making VS Code itself defective:
- The target is not recognized as a symbol. VS Code needs an available definition for the exact identifier under the pointer. Similar-looking text is not enough.
- A context rule is not active. Keyboard shortcut rules can include conditions such as editor focus, the active language, or the kind of content being edited.
- A keybinding or extension has changed the action. User keybindings, keymap extensions, and other extensions can replace or modify the default Go to Definition gesture.
- The operating system or another tool intercepts the input. System shortcuts, accessibility software, remote environments, and Linux window managers can affect whether VS Code receives the combination.
- The wrong platform modifier is being used. Cmd+Click is the usual macOS equivalent of Ctrl+Click. Holding Control on a Mac should not be assumed to produce the same result.
- Function-key hardware changes F12 behavior. Some laptops intercept F1, F2, or F12 through firmware or operating-system settings, which can prevent the keyboard-only alternative from reaching VS Code.
Test Ctrl+Click and F12 separately before changing settings. If both fail, verify that VS Code recognizes the target and that language features are available for the file. If only Ctrl+Click fails, inspect its pointer binding and context rule. This is a troubleshooting clue rather than a definitive diagnosis.
Check the binding VS Code is using
Open VS Code's built-in Keyboard Shortcuts editor with the Ctrl+K Ctrl+S chord on Windows and Linux or Cmd+K Cmd+S on macOS. Remember to release the first combination before pressing the second. You can also open it from the Command Palette by searching for Preferences: Open Keyboard Shortcuts.
-
Search for the command name Go to Definition rather than for Ctrl+Click alone.
-
Inspect the current keybinding shown for that command. If Ctrl+Click appears under a different label, confirm that the label matches your keyboard layout and operating system.
-
Check the command's when clause, which describes the context in which VS Code permits the binding.
-
Run Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette. It can show which key VS Code receives and which command is dispatched, helping distinguish an intercepted keystroke from a missing definition.
-
If the binding has been changed, use the built-in editor to restore or assign the desired shortcut. Microsoft's VS Code keyboard customization guide explains context conditions, keyboard-layout scope, and sequential chords.
The built-in editor is the source of truth for your current installation. A published default tells you what to expect, but it cannot establish which binding is active after user customization, extension changes, operating-system interception, or profile-specific configuration.
How the shortcut reference fits into the workflow
The VS Code Keyboard Shortcuts reference provides a quick way to check common defaults before troubleshooting:
-
Choose Windows, Linux, or macOS so the reference displays the correct platform modifiers.
-
Search by command name, a category such as code or symbol actions, or a key string such as Ctrl+P.
-
Compare the displayed default with the action you need, then try that shortcut in VS Code.
-
If your setup behaves differently, search for the same command in VS Code's built-in Keyboard Shortcuts editor and inspect its current binding and when clause.
The reference is intentionally limited to 20 common, source-checked default commands across navigation, editing, search, code, terminal, and file operations. It does not include every built-in command, extension command, accessibility-specific alternative, Vim or Emacs mode, or notebook and task binding. Its search is limited to a fixed in-browser table: it does not install an extension, read your VS Code settings, monitor global keyboard input, edit keybindings.json, or detect conflicts on your computer.
The platform selector is therefore important, not merely visual. Windows and Linux share many Ctrl-based shortcuts, but they are not identical. For example, the source-checked reference maps Format Document to Shift+Alt+F on Windows, Ctrl+Shift+I on Linux, and Shift+Option+F on macOS. Treat the selected mapping as a default reference, then confirm the live binding inside VS Code when customization or layout differences matter.
Related reading: MS Word Keyboard Shortcuts Not Working: Quick Checks.
Related reading: How to Format XML in VS Code: Native or Browser.