58

Visual Studio used to execute the "Naviagte Backward" command whenever I hit the back thumb button on my mouse, but it has recently stopped doing that. How can I edit Visual Studio's mouse shortcut settings to re-enable this feature?

Edit: Starting a bounty, still haven't gotten a concrete answer about this.

qJake
  • 16,821
  • 17
  • 83
  • 135
  • Have you tried to reset DevEnv settings using the "devenv /resetsettings" command? – Simon Mourier Jun 18 '12 at 06:52
  • Strange. Are you sure the button is still working, and enabled - I mean does Windows still sends messages when you click this button, outside of Visual Studio? – Simon Mourier Jun 18 '12 at 14:13
  • Yes, it works in my browser and in other third party apps (Spotify, for example). – qJake Jun 18 '12 at 15:58
  • What mouse have you got? Sometimes you can set application specific mouse shortcuts through your mouse software. – Cameron Jun 21 '12 at 14:51
  • 4
    I use Visual Studio on multiple machines with different mouses (that have thumb buttons). I'd prefer to understand why it stopped working or how I can configure it rather than rely on the mouse OEM's software. – qJake Jun 21 '12 at 16:14
  • Is it possible you're using a different language to what you used to? The IDE responds differently depending on your language. This could perhaps help if this is the case: http://www.codeproject.com/Articles/57119/Forward-Backward-Code-Navigation-with-the-Mouse-Th Also, though you've probably already tried this, export the settings from one of your other VS machines and import it into this one. If this doesn't fix it, it very likely is nothing to do with your settings, at which point you can at least look elsewhere. http://msdn.microsoft.com/en-us/library/1x6229t8.aspx – Jay Jun 22 '12 at 00:00
  • No, I'm not using a different language - it's always en-US. – qJake Jun 22 '12 at 14:36
  • Same problem here!!!! VS 2010 works fine, VS 2012 don't ! I've installed this: http://visualstudiogallery.msdn.microsoft.com/87fb8c65-d1db-49e9-a068-d62a222a4ae7. After some coding it starts to go crazy and mouse down/up do different actions. – Pedro77 Jun 12 '13 at 13:12
  • Jake you should consider accepting the answer from @Pedro77 – Chris Marisic Apr 14 '17 at 23:33
  • Fair enough, since it seems to work well enough, and with all versions of VS (even 2017). – qJake Apr 17 '17 at 18:52
  • Adjacently related: [How I can make `ctrl + click` to go to definition in visual studio code editor for mac OS?](https://stackoverflow.com/a/57446936/4561887) – Gabriel Staples May 08 '23 at 05:51

9 Answers9

26

From my topic.

Plugin that attaches Navigate back/forward to the mouse buttons: Mouse Navigation The last version (2.2.0) is working fine.

Some clarifying:
Visual Studio (2012) separates the normal navigation from "click to go" navigation.
Normal navigation: mouse click anywhere in code editor, tab change also.

Click to go navigation: Go to definition, search result click. It is controlled by the buttons named: "Browse Back / Next" "Previous/Next Definition, Declaration or Reference". You can find it in the View custom toolbar.

The default VS mouse back/forward buttons are attached to the "Browse Back / Next" buttons, not to the Navigate back/forward.

The VS plugin Mouse Navigation sets the mouse buttons to the Navigate back/forward. The only remaining problem is that because VS doesn't consider "click to go" as normal navigation, when you click to go to a definition and try to go back using the Ctrl+- or mouse back, you will not return to the last position, but to the previous "Normal navigation" position.
My suggestion to the plugin developer is to try to make VS consider "click to go" navigation as normal ones, completely solving this issue.

Community
  • 1
  • 1
Pedro77
  • 5,176
  • 7
  • 61
  • 91
9

In Visual Studio 2017 15.04 a new option was added to allow the Ctrl-Click go to definition functionality provided by the Productivity Tools. When I disabled it, my mouse back button once again started working as "navigate backward". The option is here:

Tools > Options > Text Editor > General > Enable mouse click to perform Go To Definition

Source: Visual Studio Release Notes

GadgetNC
  • 159
  • 3
  • 4
6

Are you running Visual Studio as an administrator? I know this was an issue with me and my Logitech mouse running Logitech SetPoint. If you run SetPoint as an Administrator all your buttons will start working again.

Helped me and may help others, but might not be the issue with yours.

CFraser
  • 153
  • 2
  • 4
3

Visual Studio 2010 simply lacks support for this in C++, Visual Basic and F#

Using an Add-in is an option? here is one: Forward/Backward Code Navigation with the Mouse Thumb Buttons Inside Visual Studio 2010 (C++, Visual Basic, F#)

I think it's the simplest workaround for this problem.

Jcis
  • 153
  • 2
  • 15
  • 1
    Since VS Ctrl+Click goes to sneak peek, I wanna change it to Go to Definition, and instead set Alt+Click to open sneak peek. Is that easily achievable? – Shimmy Weitzhandler Jul 29 '14 at 03:33
3

I have the same problem in VS 2012. The back button does work in IE.

Even though I agree with your feelings towards mapping the mouse buttons, I'm going to try this:

"The trick is to install the IntelliPoint software that you can find at http://www.microsoft.com/hardware. From that software you can assign a mouse click when a specific program is active, and map it to a key stroke. Set VS as the program, the keystroke to Ctrl + - and Ctrl + Shift + - to the left and right mouse buttons. You will be able to use those buttons to navigate back and forth through your open files."

http://www.microsoft.com/hardware/en-us/downloads/mouse-keyboard-center

EDIT: Alas, it does not work with my Trust MaxTrack and there is no equivalent software (to my knowledge).

I did get to assign 'Cancel Build' to the 'Calculator' key.

Laurent Etiemble
  • 27,111
  • 5
  • 56
  • 81
Luc Bloom
  • 1,120
  • 12
  • 18
1

UAC is the reason...

from Windows Integrity Mechanism Design - User Interface Privilege Isolation (UIPI) and integrity

User Interface Privilege Isolation (UIPI) implements restrictions in the windows subsystem that prevents lower-privilege applications from sending window messages or installing hooks in higher-privilege processes. Higher-privilege applications are permitted to send window messages to lower-privilege processes. The restrictions are implemented in the SendMessage and related window message functions. Not all window messages that are sent from a lower-privilege process to a higher-privilege process are blocked. Generally, “read” type messages, for example WM_GETTEXT, can be sent from a lower-privilege to a higher-privilege window. However, write type messages, such as WM_SETTEXT, are blocked.

and I don't know about any solution, since elevating the driver process is not a solution.

laika
  • 1,319
  • 2
  • 10
  • 16
  • 1
    It's got nothing to do with this. The click event is still firing, and what you've linked to describes inter-process messaging, not messaging between the OS and the application (in this case, Visual Studio). The OS handles click events from whatever driver is loaded (be it a common HID driver or a custom one) and translates those events into meaningful window messages (such as `WM_LBUTTONDOWN`). If this were true, left click wouldn't work in Visual Studio, either. The "back" button on a mouse is simply MouseButton3 (0=Left, 1=Right, 2=Middle), it's not handled differently than a left click. – qJake Apr 15 '14 at 21:29
0

I don't know if you already tried this, but it might be useful to you. I didn't try it though, so I don't know if it works well.

http://mousegesturesvs.codeplex.com/

  • I assume that you know how to put some Add-ins in your Visual Studio... :P if you don't, just ask me – FingerTheCat Jun 22 '12 at 15:36
  • 4 years old, not under active development, and is primarily used for gestures (click and hold), not mouse button mapping. Sorry, no. – qJake Jun 22 '12 at 16:39
0

Environment: Windows 10, Visual Studio 2019, Logitech Mouse (Wireless), and Logitech SetPoint (v6.70.55).

I tried installing the Mouse Navigation plugin (mentioned in another answer). With or without this plugin I had the same issue as OP - mouse navigation just did not work.

What finally worked for me was to uninstall the SetPoint software completely.

Hope this helps anyone else with this (annoying) issue!

Paul
  • 1,502
  • 11
  • 19
-4

Perform:

Tools -> Options...

Then under the Environment section on left go to Keyboard, pull up the View.NavigateBackward command, then put your cursor in the text box under Press shortcut keys:, and then press the "back thumb button" on your mouse. OK and that should do it.

NominSim
  • 8,447
  • 3
  • 28
  • 38
  • 6
    Mouse buttons are not keyboard shortcut combinations. Visual Studio is looking for something containing `Ctrl`, `Shift`, or `Alt`, not a single key or mouse button press. In fact, you can't even press a single key in that input box, you *must* type a combination of at least one key and one modifier key. This doesn't work. – qJake May 21 '12 at 15:20
  • @SpikeX Whoops, I had forgotten to mention that first you should set your mouse button press to be a keyboard shortcut combination ( this assumes your mouse allows that). That is how I customized my mouse button presses for Visual Studio. – NominSim May 21 '12 at 15:31
  • 4
    Except I'd rather keep my mouse button as MouseButton3... this allows the system to take care of a lot of predefined actions (like the Back button working in browsers, and video games responding to the click event with an ID of Mouse3). Remapping the button to a keypress is not an option. – qJake May 21 '12 at 16:40