5

The question is simple, I usually use my keyboard to navigate in VS Code, Ctrl+Tab, Ctrl+1, 2 and Ctrl+Shift+E, G, X, etc. but I haven't found a way to add a shorcut to toggle focus on the notification pop-up shown in the example.

Is there a way to do this?

Screenshot of notification pop-up in VS Code

I'm using VS Code 1.63.0

3 Answers 3

4

In the end I've found the notifications.focusToasts editor command, so I set up the following as a keyboard shortcut:

{
        "key": "ctrl+shift+=",
        "command": "notifications.focusToasts"
},
3
  • That's excellent! I'm wondering though: How do I find a command like this?
    – halloleo
    Commented Nov 18, 2022 at 3:25
  • @halloleo these are the built-in commands that come with VS code, but I haven't found an official documentation containing all of them. You can get them from the extension API with `vscode.commands.getCommands()', anyway here's a non-authoritative list someone else compiled containing all of them. Commented Nov 18, 2022 at 13:47
  • 1
    Thanks for getting back yo me! Good to know.
    – halloleo
    Commented Nov 18, 2022 at 23:08
3

Ctrl+K
Ctrl+Shift+N

There is an in-built keyboard shortcut in VS code that allows you to shift focus on to the toast notifications without having to configure the .json file.

If you press the combination when one or more notifications pop up, focus will be shifted on to the top most one from where you can use Tab to navigate between options. If there are no notifications showing up, You will see the notification center pop up when you press the combination.

Found this when I looked up for settings related to "notifications" in the Command Palette. (As in this screenshot)

Note : Press the combinations Ctrl+K (hold Ctrl and Press K) leave K, then press the combination Ctrl+Shift+N (hold Shift while holding Ctrl and press N.)

0

According to this PR, these keybindings exist:

https://github.com/microsoft/vscode/pull/43770

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .