Ctrl-C not working in visual studio 2019 when run as administrator - visual-studio

When Visual Studio runs as administrator, Ctrl-C and Ctrl-V shortcut keys are not working...
But when running VS normally - not as administrator - those shortcut keys work fine.

I have some not the same issue, as an author, but i think maybe it is somehow related.
My case is : time to time i can't press CTRL+C in my microsoft visual studio 2022 (community edition) to interupt terminal execution (powershell). For separately opened terminal (outside of Visual Studio) works great, so something wrong with VS.
Only one fix i found is to disable in options->keyboard -> edit.copy hotkey and re-assign it from "Global" to "Text editor". So, it may affect other areas, but works fine in this case. What is the core issue here and how to fix it other way i did not found.
Maybe will be helpfull for anybody.

I have this behaviour for all text-editor that I use in "Run as Administrator" mode.
The problem comes from a third-party application that uses a global hook (listens to a global hotkey) on those keystrokes (e.g. "Ctrl+C"). In my case it was a personal AutoHotKey/AutoIt3 script that was acting like a copy-paste board. But it could be some other application, or a malware.
If you disable such an application, the keyboard shortcuts Ctrl+C etc. should work fine.

In Tools=> Options => Keyboard => Check that Edit.Cut and Edit.Copy is bound to Ctrl+X and Ctrl+C
Or you can reset your settings using Reset button.

Related

Caps Locks can't be remapping via AutoHotKey in Visual Studio 2013

I have the following AHK file running to remap the Caps Locks to control.
+Capslock::Capslock ; make shift+Caps-Lock the Caps Lock toggle
Capslock::Control ; make Caps Lock the control button
It works well on other applications like Atom, Chrome, Evernote, and ect. But only has problem with Visual Studio 2013. The Caps Locks still function as caps locks. Even worth, if I accidentally pressed Caps Locks in Visual Studio and close it, I have to reopen Visual Studio and press Caps Locks again to cancel.
Is there any way to solve this issue?
Problem solved. Run AHK as administrator, because I ran the Visual Studio 2013 in admin mode. Then if any application run as administrator, the AHK should run the same, otherwise will be malfunction.
Thanks for Paul Stelian and wOxxOm.
Visual Studio seems to install some kind of keyboard handler, but I've found that simply (re-)loading my AHK after starting VS brings back my mappings. Presumably, there is some table that VS and AHK are both writing to.
There is a Reload item on the AHK tray icon's context menu.
Also, as there are other situations that will cause CapsLock to be toggled against your wishes, you probably want to either add a mapping to toggle it back (the documentation uses +Capslock::Capslock as an example), or else add SetCapslockState, AlwaysOff if you never care about using it.

Greenshot does not work in Visual Studio

Anyone know why you cannot use Greenshot in Visual Studio? I hit the Screen Print button and it does not bring up the cross-hairs to drag my window size. Instead it just takes a plain windows screenshot. I looked for keyboard commands that might override it but didnt see anything at first glance. It works for every other program but not when Visual Studio is the active window.
It's because your visual studio is running in a higher level (permission wise) than your greenshot instance.
for a one time test, close Greenshot, and run it as administrator (right click on the file, run as administrator).
As a more permanent solution, you can just set the compatibility mode for the file to be run in admin mode, and then when it's started on start up it should capture your VS instances as well :).
Edit:
Just in case, you can easily figure out if anything else is wired to a shortcut by doing the following:

How do you switch focus directly to docked windows in visual studio?

As a vim user, I am used to being able to switch the focus to different windows that are side by side with Ctrl-W [hjkl]. While Visual Studio offers very nice organization using docked windows, I find that using the Ctrl-Tab navigation window disorienting when all I want to do is switch focus to the pane that is to the left or right of the one I'm currently using.
Is there any good way to switch focus in Visual Studio between open windows?
I am using Visual Studio 2012.
As a (Vs)Vim-mer I am also looking for that essential feature.
Yesterday my VS2013 was behaving strange, but today it is working fine again (don't know what happened), i.e.:
When you have enabled VsVim Handling for ctrl+w in
Tools/Options/VsVim/Keyboard
then Visual Studio behaves like gVim.
If it happens that Visual Studio does not behave as expected (like yesterday ;-)) then you may alternatively use the similar shortcut:
ctrl+F6 which is assigned to Window.NextDocumentWindow.
This is quite sufficient to switch between both panes. If you hold the ctrl key down and typing F6 another time then it switches to another window, so release the ctrl key when having switched the pane.
You may add / change to another shortcut for this command via the Environment/Keyboard Option.

Visual Studio 2013 Debug keyboard shortcuts are not working

I just got a new computer with Windows 8 and installed Visual Studio 2013 on it and now I have an issue with debugger shortcuts - I run application in a debug mode and it breaks at the first break point but when I try going further line by line, F10 does not work from the keyboard - only VS Debug menu. Anything I am missing?
P.S. The issue was the function key. It needs to be turned on in order to use F keys
On Lenovo laptops, there is a shortcut to disable the Fn key automatically running the default Windows shortcuts.
Hit the Fn key and the Esc key at the same time to toggle the "Hot Key" default.
Hope this works for other Laptop brands since this is an easy shortcut for newer Lenovo laptops.
Please follow the instruction here, though it talks about visual studio 2010 it should help you to analyze the problem. it may be solved with the steps described there and if not, please let me know...
Why does F10 (step over) in Visual Studio 2010 not work?
Update Adding the answer from the source in case the link will be removed:
In the Options.Keyboard page, please select "Debug.StepOver" from the command listbox, and then put focus to the "Press shortcut keys" textbox and press F10, click Assign button to re-assign shortcut, does it work?
You can also try to run Visual Studio under safe mode, which will
prevents all third-party VSPackages from loading when Visual Studio
starts; if the issue disappear under safe mode, you may consider
checking your installed add-ons or VSPackages.
Second, to log all activity of Visual Studio to a log file for further
troubleshooting, please use the /Log switch, and post the log file
content here, so we can do more investigation on it.
If this feature works well before, and suddenly behave abnormally, it
usually indicate that some files or configurations of Visual Studio
installation is corrupted or missed, you can:
Restores Visual Studio default settings by using "Devenv.exe
/ResetSettings" command. Please backup your settings before restore to
default settings.
Repair/reinstall Visual Studio;
To repair Visual Studio In the Add or Remove Programs dialog box,
select Visual Studio then click Change/Remove.
I resolved my issue and wanted to post an answer in case anyone is looking for it. Enabling function key does not require any complicated solution, it can be enabled by changing settings in:
Control Panel -> Hardware and Sound (Category) -> Windows Mobility Center -> Adjust Commonly Used Mobility Settings
Look Under Function Key Behavior and change the dropdown value to "Function Key" to enable Fn key.
To disable it, select "Multimedia Key" 
See: http://elena-sqldba.blogspot.com/2015/05/how-to-enable-function-key-on-windows.html
Also check 3rd party software. In my case I had Camtasia Recorder open and minimized, which apparently intercepts the F10 input (thanks, TechSmith)
I had the same problem. My solution was a bit different and can apply to any key. My F10 key was not working. After unplugging the keyboard and plugging it back in did not fix the problem, I twisted the keyboard like an ice cube tray and the F10 key started working again.

Backspace doesn't work in Visual Studio

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.
In Visual Studio go to:
Tools
Options
Environment
Keyboard
Find "Edit.DeleteBackwards" command.
In "Use new shortcut in:" dropdown select "Text Editor".
In "Press shortcut keys:" click backspace so it would show "Bkspce"
Click "OK".
Backspace should start working for you again.
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.
I solved this issue resetting keyboard mapping scheme.
Tools -> Options -> Environment -> Keyboard -> Reset.
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.
Except for the above methods.
You should also check the shortcut key settings:
File -> Preferences -> Keyboard Shortcuts -> 'Then check the item: deleteLeft'.
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.
This method is working at 100%.
Go to "File-> Preferences -> Keyboard Shortcuts" and search for deleteLeft and add keybinding "Backspace".
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.
All I did was exit visual studio and restart it.None of the above options worked for me.
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 ;).
Try resetting your Visual Studio Settings
Go to :
All Program > Visual Studio 20xx > Visual Studio Tools
Run Developer Command Prompt for VS20xx as Administrator and this command:
devenv.exe /resetsettings
A quick work-around for me is locking the pc (Windows+L) and logging in again.
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
Visual studio 2019 : Keyboard mapping sheme
Tested in Visual Studio 2019
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.
I have this problem after I install Vim, uninstall Vim Backspace works fine.
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.
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.
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.
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.
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.

Resources