'VSCode some shortcuts not working properly
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.
Solution 1:[1]
Your operating system keyboard shortcut is overriding the vscode shortcut. You should check your operating system shortcut key instead.
Solution 2:[2]
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.
Solution 3:[3]
This resolves my issue:
Change your "keyboard.dispatch" to keyCode in the file settings.json
{
"keyboard.dispatch": "keyCode"
}
Solution 4:[4]
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!!
Solution 5:[5]
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.
Solution 6:[6]
Just restarted the Visual Studio Code and the keys are working fine.
Solution 7:[7]
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.
Solution 8:[8]
Sometimes this can happen because of change in environment variables. Please check if any recent program installations has made that change
Solution 9:[9]
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
Solution 10:[10]
Try turning on Num Lock, it worked for me.
Solution 11:[11]
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.
Solution 12:[12]
My issue is niche but never know, might help someone - YouTube Music Desktop player app was hijacking cmd, shift + l
for me.
Solution 13:[13]
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.
Solution 14:[14]
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?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow