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!

3
  • I wonder if you ever found a solution to this problem? Commented Aug 11, 2015 at 19:55
  • No, unfortunately I didn't. I ended up listening to a different key in the application I was developing.
    – digory doo
    Commented Aug 12, 2015 at 11:24
  • 2
    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. Commented Aug 12, 2015 at 11:57

3 Answers 3

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

2
  • 4
    For more information, see the following link. technet.microsoft.com/en-us/library/cc939487.aspx
    – TheSteve
    Commented Mar 15, 2017 at 6:59
  • 3
    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.
    – Tara
    Commented Feb 23, 2019 at 5:15
-1

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

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...)
    – digory doo
    Commented Sep 25, 2013 at 6:36
  • 1
    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.
    – RPG
    Commented Sep 25, 2013 at 8:44
  • 2
    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).
    – digory doo
    Commented Sep 25, 2013 at 9:51
-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.)

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.
    – digory doo
    Commented Sep 25, 2013 at 6:40
  • 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.
    – digory doo
    Commented Sep 26, 2013 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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