You can locate the commands in the options dialog (Tools -> Options -> Environment -> Keyboard
), and assign whatever keyboard shortcut you want for this. However, in your case it's two commands: one for "pinning" and another for "unpinning". Another option would be to write a macro that combines the commands:
Sub DockOutputWindow()
DTE.ExecuteCommand("View.Output")
DTE.ExecuteCommand("Window.Dock")
End Sub
Sub AutoHideOutputWindow()
DTE.ExecuteCommand("View.Output")
DTE.ExecuteCommand("Window.AutoHide")
End Sub
Then you can use the keyboard options to assign shortcut keys to these macros.
Of course you can do this in an even more advanced way. Say you have the command SetCodingMode
that will both dock the output windows and hide the test-result window and SetTestMode
that does the opposite.