Skip to content
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

Allow customization of mouse shortcuts #3130

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

Allow customization of mouse shortcuts #3130

Tyriar opened this issue Feb 18, 2016 · 371 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,

@DoCode
Copy link

DoCode commented Apr 22, 2024

In the meantime, you can use this AHKv2 script:

(Note: Works in Chrome and related editors, Notepad++, and also in Windows Terminal shells)

#Requires AutoHotkey v2.0

; Ctrl+Left Mouse button down send double-click to select the whole word under cursor (with enabled range selection)
#HotIf ((WinActive("ahk_class Notepad++") || WinActive("ahk_class Chrome_WidgetWin_1")) && A_Cursor == "IBeam") || WinActive("ahk_class CASCADIA_HOSTING_WINDOW_CLASS")
~^LButton::
{
    Send("{LButton Down}")
    Send("{Ctrl Down}")
}
#HotIf

@anaibol
Copy link

anaibol commented May 13, 2024

+1

@Azero-NG
Copy link

Azero-NG commented Jun 2, 2024

+1

@AriyaRasekh
Copy link

++1

@starball5
Copy link

starball5 commented Jun 4, 2024

To everyone who thinks it's funny to play this "+1" comment game, please read https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions, which says:

Use a reaction on the issue description rather than adding a "+1" comment.

There are currently over 200 people subscribed to this issue ticket. I at least don't enjoy getting notifications for comments like this. Think of the maintainers. If you annoy them enough, they'll lock this issue ticket, and then none of us will be able to offer help in design / implementation of this feature. I don't think anyone here wants that.

@faraon-bot
Copy link

@ivanstepanovftw
Copy link

👎

@ivanstepanovftw
Copy link

As I remember there is a working pull request, but still not merged. Why?

@AnrDaemon
Copy link

Mind sharing the link?

@psychicteeth
Copy link

psychicteeth commented Jun 12, 2024

Meanwhile half the new release notes for the latest version of VS Code are to do with AI code generation and reading it out and useless AI stuff like that. I'm going to unsubscribe from this issue - we're never getting it. I give up.

@XeonG
Copy link

XeonG commented Jun 15, 2024

It is odd init, is there a tracker to see what other active topic issues are ignored by MS despite the number of poeple still posting in them?

@darkzbaron
Copy link

+1

@madprops
Copy link

I keep messing up my code because I try to do the "swipe upwards" gesture that I use in firefox. Basically I press the middle mouse button, move upwards, and release. This triggers an action to scroll to the top. Same downwards. It would be nice if vscode was able to do this.

@AnrDaemon
Copy link

I generally try to use gestures, because Opera, and later Vivaldi let me use them throughout. Yes, their application is limited, but so common at times, it's disturbing when you naively wave your mouse and nothing happens.

@tbcarver
Copy link

This open issue seems to be so old it doesn't get the workflow love that new issues get. I wish it could be put into the pipe again as a new issue. For now it is just a tumbleweed in the void of the internet.

For those looking for ctrl+click as a select word (with drag to select more) see my post here: #3130 (comment)
It has been working for me on windows since I posted it. It still jumps up the page a bit (randomly every now and then), but overall it is usable and has really improved my workflow and cut down on so much double clicking.

As for VSCode and amazingly not getting what I would say is a basic feature for so many years, mouse button customization, I'm really thinking now that I need to give up on VSCode and the mouse and start taking Neovim seriously. https://neovim.io/

I'm at the 99% confidence that after 8 years of this feature request being open, it will NEVER happen. (in that time I have even seen a PR that adds the feature, which was also totally ignored.)

@stevekm
Copy link

stevekm commented Jul 29, 2024

I keep messing up my code because I try to do the "swipe upwards" gesture that I use in firefox. Basically I press the middle mouse button, move upwards, and release. This triggers an action to scroll to the top. Same downwards. It would be nice if vscode was able to do this.

I am not sure that this is actually a "gesture", I think it is activating an alternative scroll mode? Don't this this scroll mode is available on other browsers, fwiw, might be a Firefox specific thing? Its definitely not working in Chrome or Edge for me, or in any other app that has scrolling for that matter. So seems like might be a much bigger request than the scope for the current issue here

@madprops
Copy link

@stevekm I enable gestures through an extension called Gesturefy, it's not a native firefox thing.

https://addons.mozilla.org/en-US/firefox/addon/gesturefy/

@uberubert
Copy link

Recently I've run into an issue where ctrl+click on a typescript type goes to the wrong definition. Perhaps I could debug or fix it by tweaking mouse interaction bindings, which brings me to this 8.5 year old feature request that is massively upvoted.

I mean, they mention that they prioritise based on issue upvotes. This is the second most upvoted issue, should it then not be prioritised really highly?

Is there a plugin for mouse interaction bindings? Perhaps a status on this feature?

@brunolm
Copy link

brunolm commented Sep 10, 2024

Recently I've run into an issue where ctrl+click on a typescript type goes to the wrong definition. Perhaps I could debug or fix it by tweaking mouse interaction bindings, which brings me to this 8.5 year old feature request that is massively upvoted.

I mean, they mention that they prioritise based on issue upvotes. This is the second most upvoted issue, should it then not be prioritised really highly?

Is there a plugin for mouse interaction bindings? Perhaps a status on this feature?

So far the only thing that works is to use AHK macros.

@Brendabuena2
Copy link

/

@Brendabuena2
Copy link

@Brendabuena2
Copy link

Details

@maklmor
Copy link

maklmor commented Sep 22, 2024

+1

@iulian0512
Copy link

+1

@npaolini2634
Copy link

I find it mind blowing that it's still not possible to use middle-click to "Go to definition" rather than having to ctrl+click. This is one of the most used code navigation controls. It truly would save programmers time, like it currently does in Pycharm and other IDE's.

Please add this feature! I would pay to have this feature be available!

@razOkami
Copy link

8 years, i'm shocked

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