Custom Key Binding

The new command palette action at GitHub.com is fantastic. Is it possible to allow the user to make a custom keybinding to it? Most editors use Command + Shift + P to launch the command palette.

29 Likes

Yeah, hijacking Ctrl+K / CMD+K is not ideal.

I think over-writing print (ctrl+p or ctrl+shift+p) is fine, but being able to use ctrl+k to search with my browser is an important feature that shouldn’t be overwritten lightly.

14 Likes

(edited original comment to be more accurate)

Thanks @josephtlyons, @dorner & @thatgeoguy for the feedback! We actually originally used command+p for our internal staff ship but couldn’t get around bugs with it inconsistently pulling up the print dialog. Therefore we chose to go with command+k (and Windows/Linux equivalents) with the command+option+k alternate. I’ve shared this with our team to discuss a workaround. For now if it’s breaking your browser experience you are able to turn off the feature in Feature Preview (located in your profile dropdown).

I’ve also shared this with our Accessibility PM who is working on an accessibility feature that would allow users to remap keyboard shortcuts (incase this could also be solved by that feature).

8 Likes

I have command-K mapped to the search bar in Firefox - this was incredibly frustrating when I saw it happen since I don’t really see a need for this feature and it broke my experience. The ability to change the key might make it so I’d be interested in trying it out, but with this hardcoded I have to turn it off.

7 Likes

I think that’d be fine for me, assuming I could disable ctrl+k
specifically. As it currently stands, I have to enable both ctrl+k and
ctrl+alt+k or neither.

Additional suggestion: some of these could get quite difficult to
remember if they’re platform specific. Ctrl+/ (or Ctrl+Shift+/ or
Ctrl+?) might be useful to bring up the help window as well. Not sure
how that collides with other common plugins or whatever but I am pretty
sure that keybind isn’t used at all in default configs.

2 Likes

OP asked for Cmd+Shift+P
Your argument is about Cmd+P

Cmd+Shift+P does nothing in Edge (so presumably also Chrome, Brave).
Where are you seeing the conflict? Another browser?

3 Likes

One more on the breaks-Firefox-search-hotkey bandwagon unfortunately, so I’ve had to disable it. I’ve also got cmd+shift+p muscle memory from Sublime so a vote for that direction.

3 Likes

I think Cmd+Shift+P is kinda becoming a pattern to open the command palette.

Other than IDEs and editors, it’s the default shortcut on Chrome developer tools, some online IDE services (Codesandbox for instance -though couldn’t make it work on Firefox-).

1 Like

While a lot of IDEs have had a command pallete for ages, a lot of “trendy” Silicon Valley apps have started adding such functionality using the cmd+K shortcut (not sure why cmd+k).

Examples include Linear, Superhuman, etc. I guess GitHub took inspiration from those.

A few more examples here: Quick (cmd+k) menu · Issue #2137 · outline/outline · GitHub

Yeah, I’m on Edge in Linux, and for whatever reason, when I do ctrl+shift+k (which might be seen as ctrl+K), I get the command pallette, which isn’t ideal. In my case I’m not fussed about ctrl+k, but the fact that it is erroneously picking up ctrl+shift+k is a bit odd.

I also just had to disable this. Ctrl-K for search bar is muscle memory, won’t do without it.
But good call on not using Ctrl-P for this, notion is doing that and it’s driving me nuts because the print dialog thing mostly happens when the page just loaded, and the result is I feel like I’m waiting for my browser, even more so because of how sluggish notion is.

3 Likes

@guysherman we support multiple keyboard shortcuts for opening the command palette:

  • Mac: Command k and Command option k
  • Windows and Linux: Ctrl k and Ctrl alt k

To open the command palette directly in command mode, we also support the following shortcuts:

  • Mac: Command shift k
  • Windows and Linux: Ctrl shift k

Cmd+Shift+P opens Private Session in Firefox

1 Like

Yes! Most probably you can do so; however in such cases it’s not possible.

I’ve found GitHub to be… let’s say “bold” when it comes to assigning keyboard shortcuts for their features. They tend to conflict with everything from browser extensions, browsers themselves, and my window manager bindings. Honestly, we need a way to customize these. Or at least let’s get off the beaten path a little more than ctrl+k

2 Likes

I don’t understand why you would map it to keys that are so far apart. its impossible to do with one hand
why not just ctrl+q or ctrl+shift+a or literally anything on the left side of the keyboard?