-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS: Allow mouse buttons 4 and 5 to navigate history #8641
Comments
From my experience, this is highly dependant on one's mouse setup. Edit: I just realized that Windows actually emits a dedicated virtual key code for those buttons, Usually named something to the effect of I have a Logitech G7000s which has 8 buttons addition button. Logitech ships it with software that lets you map what happens when you press a key. I would check your mouse's manufacture to see what they have available. If there's nothing of use/usable on your OS, there's a bunch of software out there to help you do it manually. Having switched to Linux a month or so back, I had the fun experience of using |
Note that currently we only support these buttons on Windows. There they are bound to navigating in the history. |
+1 for linux support. I'd love to have the default behavior match that of other applications, or at least be customizable (e.g. browsers, eclipse). |
it's driving me crazy when I follow a definition and then want to jump back to where I was. Right now it just changes the indent on the current line. (I've been loving and abusing this in slack lately :P) |
@g5codyswartz for temporary fix you can use ctrl-o ctrl-i vim bindings with vim plugin. But having this on mouse too would be pretty sweet. (gd for jumping to definition) |
Still not implement in Electron (see electron/electron#6996) but this node module was made especially to tackle this issue. |
+1 for macOS too. Is there any reason this has to be platform-specific? |
Be great to get this in Linux. I've managed to translate across all of my IntelliJ shortcuts except for this one (Microsoft ergonomic sculpt mouse). |
Is there at least a general way of mapping mouse buttons to actions? Like if the button was just received as "button 4" or something? |
For all: please look at the beginning of the thread! This issue cannot be solved (apparently) from the VSCode side, it is (currently) a limitation from electron! |
If anyone looking for Linux solution: xbindkeys and xdotool can be used to trigger keyboard sequence on mouse clicks. This is what I'm using: ~/.xbindkeysrc
|
@skyjur That's a cute solution, but won't be satisfactory for most people I guess; nobody wants a special keyboard shortcut to be system-wise if it should only be used from within a single software! |
It can't be hard to make these bindable in Linux, and especifically in Electron apps, since my back button works fine in Chrome/Chromium to begin with (and elsewhere, including PhpStorm). |
@skyjur unfortunately that won't help Wayland users I'm afraid. This should totally be doable in the app without any hacks. |
😂 |
;) |
@skyjur thanks for the suggestion. Although I'm not completely comfortable doing this, I cannot dispense with mouse-based navigation. I'd to switch the order for Logitech MX Master 2 on Ubuntu 16.04 though. That is,
|
Seriously, this doesn't need any X hacks to work properly. Chrome and chromium work fine with mouse navigation buttons and have done so for years. Something's not wired up properly on the vscode codebase itself. |
That it works in Chrome doesn't automatically mean that it'd work in Electron apps. For what it's worth, the mouse buttons work in Slack and Spotify Windows clients (which are Electron apps AFAIK) but not in Linux clients. The related Electron issue was already linked here electron/electron#6996 |
I adopted your hacky linux workaround using xbindkeys, but I didn't want it messing with the normal mouse buttons so I did this:
I have to hit control to navigate using the buttons, but my finger is usually there since I control click to follow functions anyway. Such a silly minor thing to support the navigation buttons, but was driving me nuts. |
Thank you :) Just have a look on it and upvote. Hope we can get the response soon :) |
It looks like https://chromium-review.googlesource.com/c/chromium/src/+/1742855 fixed this for Chrome 78 and if we ship with Electron 7 this month, I can enable it. Just confirmed that it works. |
VSCode insiders has resumed with Electron 7. To benefit from this change you can give our preview releases a try from: https://code.visualstudio.com/insiders/ |
It's glorious! Thank you! |
👍 It works ! But, I have Now it's working in vscode and no more in Firefox.. 😅 |
I have upgraded to 1.43 stable version on mac, but my 4/5 buttons still doesn't seem to work... Do I need to turn on some settings? Thanks! |
If you have |
Thanks for telling me this. I don't have that software running, but indeed I am using Logitech Options driver, which might rebind my 4/5 keys to some other keys called "forward/back". Although it works on chrome, it doesn't work in vscode. After killing the driver deamon, the 4/5 keys work in vscode, but other custom keys dead... So I have to live with Logi driver. Don't know why it functions well on Windows, hope this could be fixed on mac soon! |
No there is no setting and I doubt Electron would provide the APIs for us to detect this. If you feel strong about it, ask for it over at https://github.com/atom/electron I suggest we stop discussion here and move to new issues as needed to reduce the spam for people subscribed to this otherwise closed issue. |
On macOS using a Logitech mouse with the Logi Options driver, I only needed to rebind the keystrokes that the Mouse buttons 4/5 (sidebar buttons) perform and which keystrokes the VS Code
I chose those keybindings because they continued to navigate forward/backward in Chrome for me, too. Felt like a win-win-win scenario. Screenshot of VS Code keyboard shortcuts on top with the Logi Options window on bottom macOS Catalina: 10.15.3 |
Some mice have "forward" and "back" buttons in addition to the standard ones. Would be nice to to be able to bind those to VSCode's navigateForward/navigateBack actions.
The text was updated successfully, but these errors were encountered: