Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable F10/F11 unless I'm debugging in Visual Studio?

So I have this weird problem where I press keys subconsciously sometimes. F10 (step over) and F11 (step into) are two that I keep pressing... or if I meant to hit F12, sometimes I hit F11 accidently...

Anyway, this is a major annoyance since it starts a build, which takes a while, I immediately start spamming CTRL + BREAK to break the build, but it only rarely works; it seems that it just freezes or maybe there is only a short window of time where it does work? Then if the build succeeds, my configuration is set up to do a deploy as well, and often, VS just locks and I have to end the process with Task Manager and restart VS.

So just wondering if there is any possibility to only allow F10, F11 to work when pressed if I am debugging, where I actually need it (I use attach to process so F5/F10/F11 are useless shortcuts when not debugging)?

Thanks.

like image 426
Paul Avatar asked Feb 10 '16 16:02

Paul


1 Answers

You can assign F10 to the following C# command for Visual Commander:

    if (DTE.Mode == vsIDEMode.vsIDEModeDebug)
        DTE.ExecuteCommand("Debug.StepOver");

It will call StepOver only when you are in the Debug mode. For F11 use Debug.StepInto.

like image 74
Sergey Vlasov Avatar answered Oct 20 '22 02:10

Sergey Vlasov