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

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.

Related

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

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.

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 Permanently Disable Overwrite

I have a minor annoyance with Visual Studio. In the bottom right hand corner of Visual Studio, there is a INS/OVR button to toggle Insert/Overwrite. I always have this button set to INS, and I always want it to be set to INS.
However, sometimes when I build the solution, Visual Studio changes this back to OVR. I have to click on the button to change it back to INS, which is slightly inconvenient.
I do not know why this setting sometimes changes.
Is there anyway I can permanently disable the overwrite mode in Visual Studio or prevent solution builds from changing this setting?
Visual Studio, Tools > Options > Environment > Keyboard, remove the shortcut binding for Edit.OvertypeMode
I don't think you can permanently turn insert/overwrite off. Are you accidentally pressing insert on your keyboard? You can press the insert key on your keyboard or Shift+0 on the numpad to toggle it back again.
Go to Visual Studio Code's settings and type "overtype" in the search bar, and set it to 'never'.
Hope this helped! :)
Sometimes visual studio wont disable overtype even if you hit insert with numlock on, If this happens just close script and open it again and it will work. This is a bug in visual studio.

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.

Navigating backward and forward with the mouse in Visual Studio 2008

My install of Visual Studio 2008 does not support IE style back and forward navigation withe the mouse in the C# code editor.
Searches show that multiple people have run into this problem but I have yet to find a correct solution.
There's even a VS add-in hack just to work around the "bug".
Any idea why this functionality fails for some users and how to fix it?
You can mitigate the problem by AutoHotKey tool (free, open source).
Let's assume your Visual Studio 2008 has these editor commands and their respective shortcuts:
View.NavigateBackward = Ctrl+-
View.NavigateForward = Ctrl+Shift+-
You should be able to verify these shortcuts in keyboard options. Verified? Let's proceed.
So will you be just fine if your mouse will send these keyboard shortcuts if the Visual Studio's main window is active?
Then install the tool and add the following two mappings:
XButton1::^-
XButton2::^+-
These correspond to above keyboard shortcuts: ^ = Ctrl, + = Shift, - = -
Using AutoHotKey icon in notification area, reload definition file you just updated. Now your mouse buttons should produce the above shortcuts. Test them.
If they work for you in Visual Studio editor, you can limit them only to Visual Studio main window, otherwise they work across the entire desktop:
SetTitleMatchMode, RegEx
#IfWinActive, .*- Microsoft Visual Studio
XButton1::^-
XButton2::^+-
#IfWinActive
Feel free to adjust title-matching regex if needed.
Do not forget to reload definitions file to apply any changes you made.
Bonus:
And here are some other handy operations if you are holding Shift or Ctrl:
(You have those mouse buttons, let's use them... for commands across the entire desktop.)
+XButton1::^c
+XButton2::^v
^XButton1::^x
^XButton2::^z
(Letters must be lowercase, because uppercase means Shift+letter.)
(And always make sure you are running AHK elevated (as administrator.))
Enjoy!
Visual Studio 2008 is an editor and the apps built in it can also be built in any later version such as Visual Studio 2015. Not trying to be flippant, but the fix is to move to a later version of Studio. If money is a factor look into the Community version. (See Free Dev Tools - Visual Studio Community 2015)

Resources