Skip to content

Allow customization of mouse shortcuts #3130

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

Open
Tyriar opened this issue Feb 18, 2016 · 399 comments
Open

Allow customization of mouse shortcuts #3130

Tyriar opened this issue Feb 18, 2016 · 399 comments
Assignees
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Feb 18, 2016

Some users would like to be able to customize not just pure keyboard shortcuts but also mouse + modifier ones. These are currently hard coded, for example alt+click to add a selection.

See #3091 for some more context.

@Tyriar Tyriar added the feature-request Request for new features or functionality label Feb 18, 2016
@aegyed91
Copy link

+1

I would like to do shift+cmd+leftMouseButton for Peek Definition, would be a perfect combination for me.

@jtremback
Copy link

+1

@ironcladlou
Copy link
Contributor

I've found an interesting performance implication resulting from the current defaults/lack of configurability. Consider the hard-coded modifier associated with the "peek definition" functionality. If a plugin must do some work to provide the definition, it's very likely VSCode will ask plugins for definition information even when the user has no intention of obtaining it. As I describe in microsoft/vscode-go#257 (comment):

For example, with the cursor resting still in the editor area, pressing ⌘ instantly invokes the GoDefinitionProvider, even when ⌘ is immediately used in a chord for some other command (e.g. copy, paste, opening the command palette, etc.).

This means calls to godef are happening when the user is pressing a very common key with no intention of obtaining contextual hover information.

When using vscode-go, this means significant extraneous energy usage which could be avoided almost entirely by providing modifier key settings for "peek definition". Not only would the feature be convenient and allow for better host OS GUI integration, but VSCode would be more CPU-efficient for common usages.

@davidpmccormick
Copy link

+1 – Atom, Sublime and jsbin.com (presumably others, too) all allow creation of multiple cursors with ⌘+click (on a Mac, at least). It'd be good to be forced to learn as few new shortcuts as possible when switching to a new editor.

@Tyriar
Copy link
Member Author

Tyriar commented Apr 5, 2016

I'm just completely avoiding using alt+click to add cursors until I can customize to make Windows and Linux consistent. Don't want to build muscle memory when it's going to change later.

@alexandrudima any thoughts on when you could get to this? It's blocking adding cursors via mouse on Linux. I can take a shot at it if you give a high level approach.

@JulieMarie
Copy link

+1 I just discovered VS Code and I'm loving it, but as a long time Sublime Text user on Linux, I'm missing the ctrl + click ability. Would love to be able to customize mouse shortcuts.

@Tyriar
Copy link
Member Author

Tyriar commented May 25, 2016

From @ChristopherHaws in #6853

  • VSCode Version: 1.1.1
  • OS Version: Windows 10 Pro

In Visual Studio (full version), I tend to turn off the Ctrl+LeftMouseClick go to definition feature. I personally prefer to have Ctrl+LeftMouseClick select the entire word under my mouse cursor.

From what I can see, mouse events are not configurable at the moment, and they are also not possible to override with extensions (to the best of my knowledge). It would be really nice to have a mouse mapping configuration file. Sublime Text has this (although it is sort of a hidden feature that is not exposed through the UI). Just as an example, my sublime text mousemap file looks like this:

[
    {
        "button": "button1", "count": 1, "modifiers": ["ctrl"],
        "press_command": "drag_select",
        "press_args": {"by": "words"}
    }
]

@be5invis
Copy link
Contributor

be5invis commented Jul 8, 2016

+1 for customization.
I'd like using CTRL to multi-select instead of alt.

@krux02
Copy link

krux02 commented Aug 4, 2016

I would like to note, that adding cursors with the mouse is impossible on Linux, because alt+click is already used to move the window around (at least on KDE and XFCE), and therefore the alt+click behavior doesn't reach the code editor at all. So I would also suggest to change the default binding to something that doesn't conflict with key combinations of major window managers. Ctrl+Alt+click could work,

@madprops
Copy link

madprops commented Dec 5, 2024

It's probably too complicated and nobody dares to refactor it. My advice is to configure your window manager to translate some mouse actions into others. Awesomewm is very flexible for this, for example I added song queue on middle click even though Audacious doesn't support this natively. On Windows you probably can use Autohotkey.

@tbcarver
Copy link

tbcarver commented Dec 5, 2024

@madprops It's not "too" complicated, in the last 8 years there has been a pull request for vs code and an extension that relied on it that implemented this feature. Many usable ways to work around the missing feature using auto hotkey has already been documented in this thread.

This ticket should actually just be closed by Microsoft as "will not do" and just end the thread and the misery of people actually thinking they would ever take any interest in implementing this basic IDE feature.

@alphaho
Copy link

alphaho commented Dec 14, 2024

For Mac users, to mimic IntelliJ's middle click behavior, here is my workaround config to map middle_click to cmd + left_click through Karabiner-Elements:

{
    "description": "VS Code middle click",
    "manipulators": [
        {
            "conditions": [
                {
                    "bundle_identifiers": [
                        "^com\\.microsoft\\.VSCode$"
                    ],
                    "type": "frontmost_application_if"
                }
            ],
            "from": { "pointing_button": "button3" },
            "to": [
                {
                    "modifiers": ["left_command"],
                    "pointing_button": "button1"
                }
            ],
            "type": "basic"
        }
    ]
}

@nareshrathnam
Copy link

+1

@FMorschel
Copy link

Hey @hediet, this issue has been assigned to you for years. Are you intent on working on it in 2025? This is the second most upvoted feature on the issue tracker.

@brunolm
Copy link

brunolm commented Jan 15, 2025

Looking at the backlog, it seems there's 128 things in front of this one.

Looking at recent issues closed, it ranges from 3-16 per week.

This one in particular could take 8-42 weeks just to have someone start working on it (assuming nothing else gets higher priority than this).

In other words, just give up on this, look into AHK and build some scripts with that instead.

@mnn
Copy link

mnn commented Jan 15, 2025

In other words, just give up on this, look into AHK and build some scripts with that instead.

It's been a while, but I believe I was already exploring it (well, a similar approach, since AHK is, I believe, Windows-only). I think binding middle mouse button to emulate Ctrl+B ("Go to definition") led to some weirdness when I used middle mouse button to close a tab.

@AnrDaemon
Copy link

If you have a programmable mouse that exposes a HID keyboard, assigning extra buttons to some Fx keys may help the issue.

I.e. I have an A4tech X7 series mouse (it is hardware programmable), and I've changed its 3 extra buttons to emit F10/F11/F12 codes.
Works extremely well in all applications, since it's recognized by system as just another keyboard.
Just a note to those using it: if you have a mouse that has multiple physical profiles (my X-740K has two banks), program both modes to the same functions, else you'd be in for a surprise, when the mouse switch the mode one day. Some variants advertise "5" or "7" profiles, but in fact they only have one and use helper program to upload profiles on the fly.

@anay-208
Copy link

8 years, i'm shocked

9 Years Now. I'm still waiting for this feature

@egrieco
Copy link

egrieco commented Jan 21, 2025

8 years, i'm shocked

9 Years Now. I'm still waiting for this feature

Based on @brunolm's info above, we'll probably be waiting for another year or two, if not indefinitely.

In large tech orgs, no one gets promoted for addressing basic user experience/usability issues. I had Apple ignore a similar issue for a decade or two back when I was a Mac user. I believe it is still unaddressed. 😦

@fabiosangregorio
Copy link

Please add this 🙏🏻

@drygiel
Copy link

drygiel commented Feb 15, 2025

Shall we beg? ;/ That's why JetBrains IDEs are better

@BuddyLongLegs
Copy link

Need this badly 🙏

@anay-208
Copy link

I currently have a mouse with 2 extra buttons, which are doing absolutely nothing, and could do something if this feature becomes live.

@FMLS
Copy link

FMLS commented Mar 5, 2025

Need this badly 🙏

@babakfp
Copy link

babakfp commented Mar 8, 2025

@SebastianHorluck
Copy link

SebastianHorluck commented Mar 26, 2025

Please add this 🙏🏻

@greenwookez
Copy link

+1

1 similar comment
@amitoh
Copy link

amitoh commented Apr 8, 2025

+1

@Dok11
Copy link

Dok11 commented Apr 8, 2025

And no one write about MouseWheel?
I would like to add keybinding "Ctrl+MouseWheelDown" and "*Up" for "Open Next Editor" and "Previous".
PhpStorm allow to do this at least last 5 or 10 years like:

Image

@feinstein
Copy link

Don't forget to include the macbook long-press please, as in IntelliJ a long press can jump to definition

@mgiacomi
Copy link

Please please please can we implement this.

@daniel-solving-ai
Copy link

honestly a shame.. im trying to migrate from PHPstorm to VScode but definetly not feeling it... cant change years of muscle memory just because they wont implement mouse keybinds...

@egrieco
Copy link

egrieco commented Apr 27, 2025

We're less than a year from the one decade anniversary of this issue being reported! 🥳

@bugslayer01
Copy link

just a noob here, but is it possible to make an extension for this that can connect with stroke plus or other similar applications

@AnrDaemon
Copy link

We're less than a year from the one decade anniversary of this issue being reported! 🥳

-reported
+ignored

@pungggi
Copy link

pungggi commented May 1, 2025

I tried to implement an extension working when in an editor. But the vsc api does not allow to listen to mouseevents (might be a security concern) but I managed to using a separate webview for tracking a gesture. have a look Mouse Gestures for Visual Studio Code
Here is a demo: microsoft/vscode-discussions#2593 (reply in thread)

@karanbangia
Copy link

wow...i broke my finger...just switched from goland to vs code , goland has an option to assign mouse shortcut, so I assigned it to a middle mouse click, and this is open since 2016, so I need to go back to goland i guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues
Projects
None yet
Development

No branches or pull requests