How to disable F12 to debug application in Visual Studio 2012
Asked Answered
H

3

18

If I hit F12 while my application runs under Visual Studio in debug mode, the WM_KEYDOWN never reaches my event loop, but it immediately triggers a breakpoint. Is it possible to disable this feature, or reassign it to another, less conflicting hotkey (e.g. CTRL+F12)? I figure the must be a registry key, but I can't find it...

Any help is greatly appreciated!

Horseleech answered 25/9, 2013 at 6:29 Comment(3)
I wonder if you ever found a solution to this problem?Engine
No, unfortunately I didn't. I ended up listening to a different key in the application I was developing.Horseleech
Thank you for the response. I ended up using the same approach. I just couldn't believe my eyes what I was reading on MSDN about F12 and it took me like 2 hours to figure it out.Engine
E
23

F12 is a reserved key for the debugger and its kernel-based https://msdn.microsoft.com/en-us/library/windows/desktop/ms646309.aspx

But you can change the registry entry

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug] UserDebuggerHotKey=dword:00000000

to something else like 0x13 (Pause)

got this from http://conemu.github.io/en/GlobalHotKeys.html

Enchantment answered 13/12, 2016 at 20:34 Comment(2)
For more information, see the following link. technet.microsoft.com/en-us/library/cc939487.aspxVicinal
Any idea why this only started happening recently for me? I was using F12 to save screenshots for years. Only recently this problem popped up. I think it might be related to me switching from VS2013 to VS2017. However when I look up information about that hotkey, the articles about it are way older than either of those VS versions.Ischia
J
-1

You can disable it from Tools->options->Keyboard

Jose answered 25/9, 2013 at 6:34 Comment(3)
I've looked into that, but I can't find the corresponding command. (It isn't too easy to browse this huge catalogue in a scroll field that shows three lines only...)Horseleech
Maybe this will help you: msdn.microsoft.com/en-us/library/vstudio/… F12 is used only for Navigation by default. So maybe you have a add-in that changed your default key-mapping, like resharper.Jose
The link points to a list of the shortcuts within Visual Studio. No, we haven't any add-ins, it's the default behaviour. F12 is special, and I think it's even Kernel-based, see msdn.microsoft.com/en-us/library/windows/desktop/… (search for F12 on that page).Horseleech
A
-2

It's easy to reassign a value like that to whatever you want.

1) Go to Tools/Options and click on Keyboard (under environment). Then find the command associated with F12. Which one depends on which mapping scheme you use, so I can't tell you the one to find.)

Then change it to whatever you want.

Too bad I can't add comments...

When I type in F12 (for Press shortcut keys), I get Edit.GoToDefinition. If I remove that assignment and then try again, it shows how it is used with Page Inspector.

If you enter F12 and nothing shows, then you can assume that VS is not using F12 and something else is.

You can just try assigning F12 to something and see if that is called instead - then at least you will have some idea of if VS is controlling it or something external to VS is.

Remember that you could also have some application that has remapped F12 so that when you press it, your application is getting a signal that some other key or key combination has been pressed (happened to me once.)

Arnoldoarnon answered 25/9, 2013 at 6:38 Comment(2)
I click into the field "Press shortcut keys" and hit F12. The field "shortcut currently used by" only lists the assignments inside Visual Studio, but not the one inside the running application.Horseleech
It's Visual Studio. You can try it for yourself, just start any C++ application in debug mode and hit F12 -- the debugger will immediately pop up. Don't know if this is true for C# or Java as well, but with C++ it's certainly VS's default behaviour.Horseleech

© 2022 - 2024 — McMap. All rights reserved.