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

Add a way to bind a keybinding for a command from the F1 list #27716

Closed
alexdima opened this issue May 31, 2017 · 13 comments
Closed

Add a way to bind a keybinding for a command from the F1 list #27716

alexdima opened this issue May 31, 2017 · 13 comments
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders keybindings VS Code keybinding issues quick-pick Quick-pick widget issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

I think we've discussed this, but we've never written it down.

IMHO, it would be very helpful to have an alternative action next to each command in the F1 list (similar how open to the side is an alternative action in the ctrl+p file list) that when executed would bring up the keybindings editor with the action selected and will execute the "edit" action on that command.

e.g. I use Git: Stage Selected Ranges and today I always run it from the F1 list because it is not bound. It would be nice to have an action that allows me to record a keybinding for it such that I can easily map it.

@bpasero
Copy link
Member

bpasero commented May 31, 2017

This is relatively simple, I just helped Dirk to get actions into the task quick open.

@sandy081 if there is API I can use to do what @alexandrudima is suggesting, I can add such an action. E.g. it could show up with a gear icon similar to how Dirk is doing it for tasks:

image

However we also have to think about how often people are using the commands picker and how many want such a prominent action.

@bpasero bpasero added feature-request Request for new features or functionality workbench labels May 31, 2017
@bpasero bpasero added this to the Backlog milestone May 31, 2017
@sandy081
Copy link
Member

@bpasero There is no API to show the keybinding defining widget. But I can do it.

@sandy081 sandy081 added the keybindings VS Code keybinding issues label May 31, 2017
@bpasero bpasero added the quick-pick Quick-pick widget issues label May 31, 2017
@sandy081 sandy081 modified the milestones: June 2017, Backlog Jun 7, 2017
@bpasero bpasero removed their assignment Jun 9, 2017
@sandy081 sandy081 modified the milestones: Backlog, June 2017 Jun 26, 2017
@bpasero bpasero removed the workbench label Nov 16, 2017
@sandy081 sandy081 modified the milestones: Backlog, November 2017 Nov 27, 2017
@sandy081 sandy081 added keybindings-editor Keybinding editor issues and removed keybindings-editor Keybinding editor issues labels Nov 27, 2017
@sandy081 sandy081 modified the milestones: November 2017, Backlog Nov 27, 2017
@bpasero
Copy link
Member

bpasero commented Mar 12, 2020

With the new quick access for commands this is relatively easy to add by adding the following:

buttons: [{
  iconClass: 'codicon-gear',
  tooltip: localize('customizeTask', "Configure Keybinding")
}],
trigger: () => {
  // Open keybindings editor etc...
  return TriggerAction.CLOSE_PICKER;
}

to this object:

It looks a bit overcrowded though:

Kapture 2020-03-12 at 10 43 04

@alexdima
Copy link
Member Author

This is cool! But I agree it looks funny when the keybindings are pushed out of the way.

@sandy081 sandy081 modified the milestones: Backlog, April 2020 Mar 13, 2020
@alefragnani
Copy link

If you leave the gear icon space “reserved”, the funny behavior would go away. But you end up with less space available for command description/shortcuts.

Another idea would be adding the gear icon at the top of the QuickPick, similar to what you have while using multi-step QuickPicks. But if I remember correctly, this would add a Header to the QuickPick 😕 .

Maybe @misolori has some ideas?

@miguelsolorio
Copy link
Contributor

@bpasero could we change the order and place the gear on the left-most side of the keybindings?

@bpasero
Copy link
Member

bpasero commented Apr 17, 2020

There is currently just one fixed location for actions in the quick pick widget, we would have to add another action bar. Maybe post a screen shot from Figma what you think about to check how it looks?

@miguelsolorio
Copy link
Contributor

Something like this:

image

@bpasero
Copy link
Member

bpasero commented Apr 17, 2020

Yes, that is doable. We currently create the container for keybindings first and then the action bar but we can probably flip that:

const keybindingContainer = dom.append(row1, $('.quick-input-list-entry-keybinding'));

I am not sure though that having an action at varying positions is a good idea for users to use.

@miguelsolorio
Copy link
Contributor

miguelsolorio commented Apr 20, 2020

Another alternative, hold down option (or some other key) and we hide the keybinding and show a blue "Set/Change Keybinding"? Less discoverable but also doesn't clutter up the UI. We do this in other place like closing multiple tabs.

Personally, I'm not sure how useful it is to have this but using it via option provides the best of both worlds.

@gjsjohnmurray
Copy link
Contributor

Any way the gearwheel could replace the existing keybinding symbols when the mouse goes over one of them?

@bpasero
Copy link
Member

bpasero commented Apr 22, 2020

Any way the gearwheel could replace the existing keybinding symbols when the mouse goes over one of them?

That will be problematic for accessibility reasons we cannot do this only on mouse hover, it would have to be on the selected item as well. This would mean the selected (e.g. first) item would never show its keybinding, which imho defeats the purpose.

@sandy081 sandy081 modified the milestones: April 2020, Backlog Apr 24, 2020
@sandy081 sandy081 modified the milestones: Backlog, November 2020 Nov 13, 2020
@sandy081
Copy link
Member

Added Configure Keybinding button (Gear icon) to the commands quick pick -

image

Clicking on it opens the Keyboard Shortcuts Editor showing above command

image

User can configure keybinding for this command from the editor.

meganrogge pushed a commit that referenced this issue Nov 18, 2020
@sandy081 sandy081 added the verification-needed Verification of issue is requested label Nov 30, 2020
@jrieken jrieken added the verified Verification succeeded label Dec 1, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders keybindings VS Code keybinding issues quick-pick Quick-pick widget issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants
@bpasero @jrieken @alefragnani @alexdima @gjsjohnmurray @sandy081 @miguelsolorio and others