Handle keybindings when editor is not focused #9231
-
Does this extension only handle keybindings when an editor is in focus? For example I have the following keybindings {
"before": ["<leader>", "s", "o"],
"commands": ["workbench.action.focusSideBar"]
},
{
"before": ["<leader>", "s", "c"],
"commands": ["workbench.action.closeSidebar"]
}, the first one works, the second does not. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am not sure if this is the recommended solution but I found out that you can define multi-chord keybindings directly in the keyboard shortcuts JSON file (it does not work through the GUI). For example something like this {
"key": "space e e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarFocus"
}, works. Though the |
Beta Was this translation helpful? Give feedback.
I am not sure if this is the recommended solution but I found out that you can define multi-chord keybindings directly in the keyboard shortcuts JSON file (it does not work through the GUI). For example something like this
works. Though the
when
expression is important in this case because otherwise the Space key will stop doing its job as VS Code will expect you to be triggering a keyboard shortcut whenever you press Space.Hopefully this helps someone else looking for a solution.