Reputation: 1494
latest version 1.40.1 on Windows 7 x64. I am developing in Java.
The most common shortcut, "go to definition" F12 and "auto fix" ctrl+dot I tested it on another computer with 1.40.1. It works properly. I have follow the key binding troubleshooting guide. When I record my key ctrl+dot. It shows ctrl+oem_period. Looks like the OS is sending the correct keys to VSCode.
I couldn't find a way to reset VSCode key bindings and do not know what is actually causing this. What should I do next? Completely reinstall everything is the last resort.
Upvotes: 62
Views: 197185
Reputation: 3417
You may also need to check the when
clause of the Keybinding. In my case, I was struggling with why "Command+R" wasn't reloading the window on my Mac. By right-clicking on the row of the relevant command in Keyboard Shortcuts, then clicking "Change When Expression" and removing the expression completely, the keybinding now works as expected.
Source: https://github.com/microsoft/vscode/issues/108393#issuecomment-706215895
The when
clause may also show prerequisite situations for the keyboard shortcut to work. For example, if you select a file in the folder list pane and then try the keyboard shortcut for Trim Trailing Whitespace (Ctrl+K, Ctrl+X on Windows), it fails with a status bar message saying The key combination (Ctrl+K, Ctrl+X) is not a command.
Looking at the when
column in File > Preferences > Keyboard Shortcuts shows that one of the prerequisites for Trim Trailing Whitespace is editorTextFocus
. And indeed, clicking the cursor into the text editor window after selecting the file in the folder list pane causes the keyboard shortcut to start working.
Upvotes: 5
Reputation: 1
This problem occurs mostly on VScode installations which were installed using user-installer in windows system. Solutition: Close the running Vscode application. Get the System installer under https://code.visualstudio.com/download# for windows and excecute it. Restart your application and the shortcuts problem is gone
Upvotes: 0
Reputation: 507
In addition to my previous answer to this question, I just now discovered that multiple key bindings within VSCode stop working whenever I open/run Microsoft Word.
Upvotes: 0
Reputation: 507
For me, the key binding "Alt+Z" (toggle "Word Wrap") wasn't working within VSCode on Windows 11. The computer I'm using has an AMD graphics chip, and there's an "AMD Software" app that, by default, allocates multiple keyboard shortcuts at the system level, including "Alt+Z".
I opened the AMD Software app, opened the app's SETTINGS page, selected the HOTKEYS tab, and disabled the app's keyboard shortcuts. Afterwards, I was able to use the "Alt+Z" key binding within VSCode.
Upvotes: 0
Reputation: 21
The Simple Solution i found is the Extention called Vim, Uninstall it Works okay thank me later.
Upvotes: 0
Reputation: 1736
I solved this issue by using command pallete , shortcut option , I followed the following steps,
View /CommandPallete/keyboard Shortcuts
Just take a look that, is there any extension using those shortcut to invoke their functionality. In my case BlackBox extension was using those shortcut to launch their tab.
Upvotes: 0
Reputation: 319
Go to keyboard shortcuts as follows File > Preferences > Keyboard Shortcuts
Go to this link check here and add that content to that above keybindings.json
file
Save them and check your short cut. It should work now... It worked for me... All the best...
Upvotes: 0
Reputation: 89
On VS Code,
Upvotes: 8
Reputation: 151
Sometimes, The installed extensions may be the cause, For example:
I installed "Vim" extension Thus, Some shortcuts failed to work again. Some of those shortcuts are: "Ctrl + A" , "Ctrl+C", "Ctrl+X" but I uninstalled VIM extension to make my shortcuts work again!
Why? Some extensions has their own shortcuts which can confuse you because of different functionalities!
Upvotes: 0
Reputation: 21
In my case, I can't use ctrl+`. I've tried to restart VS Code but this problem still occurs.
After some checking, I figure out that my keyboard language accidentally changed to Japanese, after switching to English, the shortcut ran perfectly.
Pict. Change keyboard Language
Upvotes: 2
Reputation: 36
For me, It is the keyboard layout setting that causes this. Use English US keyboard setting.
Upvotes: 0
Reputation: 625
Extensions you add to VSCode also can override the ordinary behavior of shortcuts. I faced to this problem, I've noticed that the ordinary shortcut command
+ L
which selects the whole line, does not work, and the reason was Live Server
extension, which overrides that shortcut, after its deletion shortcut became work properly
Upvotes: 1
Reputation: 1
I just deleted folder in %APPDATA%\Code\
resets whole vs code and fixed my problem with alt + b and other vs code shorcuts not working
Upvotes: 0
Reputation: 11488
MacOS users,
This is a default macOS shortcut. VSCode is never getting the meta+shift+L message from your OS. Your OS is hijacking it. You need to disable it.
System Settings > Keyboard > Shortcuts > Services > uncheck: Search with Google
Source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000435950/comments/360000170990
This is a default macOS shortcut, you can disable it at System Settings | Keyboard | Shortcuts | Services| Search with Google. https://apple.stackexchange.com/questions/180038/strange-behavior-within-ms-word-using-command-shift-l-launches-safari-sometimes
Upvotes: 2
Reputation:
This worked for me to fix CTRL+Space "Trigger Suggest". First I found and disabled this setting in: System Preferences > Keyboard > Shortcuts > Input Sources
Then I followed @ryandidevar's instructions and replaced everything for Mac: https://stackoverflow.com/a/72187880/14353462
Finally, I set "Trigger Suggest" in VSCode > Preferences > Keyboard Shortcuts to: CTRL+§ (which is right next to my "Z" key). CTRL+Space just would not be accepted under any circumstance. Now hitting CTRL+§ finally brings up the suggestions!
Upvotes: 2
Reputation: 59
In my case, I have installed some "vim keyboard extensions" and others. so I have uninstalled all the extensions related to the "keyboard" i.e. "vim keyboard extension" and now it is working fine. it is recommended to check if you have downloaded any extensions for the "keyboard" in the extensions and uninstall it. It might solve the issue.
Upvotes: 2
Reputation: 961
Woo, found my issue was Razor Naga stuff. After I updated some of the Razor apps (it has Synapse, Cortex, etc), this issue started happening. Now, I saw these apps are running in the background although I am not using the devices at this time, and once I quit them, VSCode went back to normal thankfully.
Upvotes: 0
Reputation: 678
99% works.
Forget everything that may overrides your keyboard shortcuts. The problems is your keybindings.json
file, if you fix it you'll fix your problem.
I found the solution and I've explained it in the following link: Why vscode shortcuts don't work properly?
Upvotes: 2
Reputation: 1
In my case, my Ctrl keys were mapped to the Toggle extension and this extension could not overwrite one of my settings in the settings.json because I had pending changes that hadn't been saved. Once I saved the file, I was able to use the toggle keyboard binding again. I used the guidance from Martin above to determine the cause of the issue.
Upvotes: 0
Reputation: 339
My issue is niche but never know, might help someone - YouTube Music Desktop player app was hijacking cmd, shift + l
for me.
Upvotes: 0
Reputation: 1
I have tried many methods to solve this problem ,not every problem of mine got solved so I use this method after I cant find the solution.
you can first uninstall the VS code and then delete the .vscode file from C=>user=>admin=>.vscode
after that reinstall vscode ,from my end its working fine after doing this.
Upvotes: 0
Reputation: 949
In my case, "cmd+k cmd+0" which helps to fold all regions was not working. Another extension was using the same shortcut. I followed the steps below to fix it.
Here are the steps to fix this
Press "cmd+shift+p" to open command palette
Type "Preferences: Open Keyboard Shortcuts" and hit enter
Press "option+cmd+k" to start recording keys.
Press the short cut keys that are not working (in my case "cmd+k cmd+0" ). This will list all the instances of that shortcut keys. And there are probably multiple instances of the same keybindings with some of them being used by an "Extension" as shown under the "Source" column.
Remove that and keep only that instance which says "Default" under "Source" column.
Now, you should able to use the default keyboard shortcuts.
Upvotes: 15
Reputation: 41
Sometimes this can happen because of change in environment variables. Please check if any recent program installations has made that change
Upvotes: 2
Reputation: 21
Resolved :
Facing similar issue. Several keyboard shortcuts stop working when code starts running. In my case it was happening because of notepad++ extension. Disabling that extension resolves the issue.
Upvotes: 2
Reputation: 321
This resolves my issue:
Change your "keyboard.dispatch" to keyCode in the file settings.json
{
"keyboard.dispatch": "keyCode"
}
Upvotes: 22
Reputation: 1857
With the command Developer: Toggle Keyboard Shortcuts Troubleshooting
, you can see which command is linked to a shortcut. It could happen that an extension is overriding the expected behaviour.
For example, I had an extension overriding the shortcut to reopen a closed tab, which didn't work anymore.
Upvotes: 96
Reputation: 744
I was facing the same problem after I updated my Intel Graphics Command Center using Windows Updates.
The Add One Cursor Above/Below shortcuts were not working for me.
I started the Intel Graphics Command Center, and then went to System > Hotkeys tab, Enabled System Hotkeys as shown in the picture below.
I flipped my screen a couple of times using the keyboard shortcuts and then disabled once again.
Then switched back to VSCode and the keyboard shortcuts were working!!
Upvotes: 6