104

I keep getting a very annoying problem in Visual Studio. When I try to delete some text by pressing backspace it doesn't work. Why is this? What is going on? Sometimes I have to close and open Visual Studio to make this problem go away but I just tried that right now and it didn't work. Backspace works in Notepad in case you are wondering.

10
  • 1
    Are you using any vs add-ons?
    – sithereal
    Commented May 28, 2012 at 14:28
  • Resharper - but I've disabled it. Commented May 28, 2012 at 14:32
  • 1
    Problem while installing software. Reinstall it may fix the problem Commented May 28, 2012 at 14:34
  • I installed Visual Studio a long while ago and this problem only started recently. Commented May 28, 2012 at 14:37
  • 1
    You maybe changed an option or something. the best way is reinstall it Commented May 28, 2012 at 14:42

22 Answers 22

83

In Visual Studio go to:

Tools 
Options
Environment
Keyboard
  1. Find "Edit.DeleteBackwards" command.
  2. In "Use new shortcut in:" dropdown select "Text Editor".
  3. In "Press shortcut keys:" click backspace so it would show "Bkspce"
  4. Click "OK".

Backspace should start working for you again.

2
  • 2
    I had this same problem happen but I am really curious how it happened. Did I maybe hit some random shortcut that changes the mapping...??
    – Zhuge
    Commented May 1, 2020 at 23:14
  • Thanks, seems using default in “Apply the following additional keyboard mapping scheme” in the keyboard setting UI will cause this issue, but if changed to Visual C# 2005, it worked.
    – Frank Yuan
    Commented Feb 2, 2021 at 7:37
65

This seems to happen to me when I open a solution and there are files already open. I used to close the files, then close and re-open the solution to fix it, but now I just hit Alt + Enter.

Here is the blog where I found this trick.

2
51

I solved this issue resetting keyboard mapping scheme.

Tools -> Options -> Environment -> Keyboard -> Reset.

21

A quick fix for me is to simply open any menu from the menu bar. Once the menu is closed the non-character keys start to work again.

2
  • 2
    This worked for me in VS Code as well! Debugging a Python program in VS Code v1.64.2 Commented Feb 18, 2022 at 19:30
  • WORKED! Version 17.8.6
    – Miltos
    Commented Feb 8 at 17:31
11

Except for the above methods.

You should also check the shortcut key settings:

File -> Preferences -> Keyboard Shortcuts -> 'Then check the item: deleteLeft'.

enter image description here

2
  • though backspace works for me , select and delete doesnt work for me. any idea why? Commented Jan 20, 2022 at 15:49
  • 1
    This is helpful for Visual Studio Code however, the question is for Visual Studio.
    – Himanshu
    Commented Jan 5, 2023 at 11:37
9

I get this from time to time in VS2010 as well and simply just using the mouse to change tabs/files seems to always fix it now. Nothing more.

2
  • To add to this - I think when I've encountered this it's been because VS has somehow lost track of the "active tab". It thinks some other tab is active so it's doing your edits on that other tab/file. Very weird issue. Commented Jun 30, 2020 at 17:26
  • though backspace works for me , select and delete doesnt work for me. any idea why? Commented Jan 20, 2022 at 15:49
5

This method is working at 100%. Go to "File-> Preferences -> Keyboard Shortcuts" and search for deleteLeft and add keybinding "Backspace".

1
  • VSCode solution - verified
    – clay
    Commented Dec 12, 2020 at 17:10
4

Odd that this is still an issue even in VS 2019. Both the backspace and delete keys didn't work. Quick fix, I just ran the project and it seemed to give it the kick it needed.

0
3

All I did was exit visual studio and restart it.None of the above options worked for me.

2
  • 1
    This happens almost every time I install a nuget package or load\reload an existing project. alt + enter sometimes works, otherwise this is the only other way to fix it. Commented May 4, 2016 at 16:19
  • 1
    This works for me. For 15 minutes. And then I have to restart again...
    – Peter B
    Commented Aug 4, 2020 at 8:58
3

In my case the problem was the "When" Condition in "File-> Preferences -> Keyboard Shortcuts".

I removed "textInputFocus && !editorReadonly" and it works now as expected. I'm looking forward to the side effects ;).

3

Just had this exact issue (along with 'Enter', 'Ctrl+X', 'Ctrl+C', 'Ctrl+V', 'Ctrl+Z' keyboard mappings seemingly doing nothing) in the latest VS preview version below:

Microsoft Visual Studio Professional 2022 (64-bit) - Preview Version 17.2.0 Preview 6.0

The fix for me was to move to another tab (I had multiple open) use the backspace key which worked fine, then move back to the original tab with which it wasn't working, save the file (as it had outstanding changes) and then I found backspace and all other shortcuts then worked!

I can only think that VS got in a locked (to keyboard mappings) state for that particular tab.

A few notes on this:

  • I knew it wasn't a keyboard issue as I was able to use those keys/mappings fine in other apps.
  • I found closing and reopening VS didn't work.
  • Also resetting the keyboard mappings (through Options menu as others have described) didn't work.
  • I had multiple tabs open.
  • Resharper was disabled.
2

Try resetting your Visual Studio Settings

enter image description here

Go to :

All Program > Visual Studio 20xx > Visual Studio Tools

Run Developer Command Prompt for VS20xx as Administrator and this command:

devenv.exe /resetsettings

2

A quick work-around for me is locking the pc (Windows+L) and logging in again.

2

You can reset keyboard mapping scheme like this

Options => Environment => Keyboard then select (Default) in the comboBox and click Reset button and then Ok button to confirm

enter image description here Visual studio 2019 : Keyboard mapping sheme

Tested in Visual Studio 2019

0
1

This problem happened for me when I used a different version of resharper at home and then took that project to my employment. Backspace works for me now after I deleted the bin and obj and resharper directories.

1

I have this problem after I install Vim, uninstall Vim Backspace works fine.

1

When this issue has happened to me, I've found that hitting delete or backspace is unresponsive only within a portion of my code. This portion happened to be some code that I've pasted in from the internet somewhere.

To fix this issue, I cut out the recently pasted problematic code and then pasted it into a text editor like Notepad++. Then copying and pasting that same code out of the text editor and back into Visual Studio fixed the problem.

1

Using Visual Studio Community 2019 (16.4.3)

I just searched this issue because I could click in my document, type, et cetera, but I could not use backspace, delete, ctrl+z, or the arrow keys.

Opening the "File" menu, I noticed the Save option referred to a different file. I checked that file and found that all of the keys that seemed not to work were actually editing that other file.

Switching between the file in half-focus and the file I intended to edit worked and, luckily, undo was able to fix the file I unknowingly butchered.

If you wound up here, check your "File" menu to make sure the correct file is referenced, since the fix is quick and easy to try.

1

I just had this happen in one instance of Visual Studio 2022, caused by the debug settings editor window being open in another instance of Visual Studio 2022 in the background where I couldn't see it.

Closing that window resolved it.

1

Had Vim extension installed without my consent and had to press I to get to edit mode

0

go settings > keyboard shortcuts

then you will see this kind of interface there type "deleteleft" in my case that has been assigned to shift + backspace you can edit that one with selecting edit icon and pressing the key you need. check this image.

enter image description here

enter image description here

1
  • Thats visual code not visual studio.
    – WDUK
    Commented Jan 16 at 22:57
-2

I've had this issue for a long time. I'm not sure what causes it, but Alt + Enter works. The extensions that I'm running include AnkhSVN, MySQL Tools, and Productivity Power Tools.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.