首页 > 解决方案 > 如何在 VSCode 中制作仅由修饰符组成的键绑定?

问题描述

如何制作仅由修饰符组成的键绑定?例子:

{
  "key": "shift+alt",
  "command": "cursorLeft",
  "when": "editorTextFocus"
}

标签: visual-studio-code

解决方案


执行此操作的一些功能出现在 Insiders' Build v1.54 中,请参阅 Feature: Shift Shift, Ctrl Ctrl, Alt Alt Keybinds (Double press modifier keybind support)

但是,它仅限于:

Shift Shift
Ctrl Ctrl
Alt Alt
Meta Meta
Win Win

所以"key": "shift alt"不起作用。

所以你可以做

{
  "key": "shift shift",
  "command": "cursorLeft",
  "when": "editorTextFocus"
}

注意+修饰键之间没有,所以

  "key": "shift+shift",

目前不工作 - 测试。


推荐阅读