如何在 VSCode 中创建仅由修饰符组成的键绑定? [英] How can I make a keybinding composed of only modifiers in VSCode?

查看:31
本文介绍了如何在 VSCode 中创建仅由修饰符组成的键绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I make a keybinding composed of only modifiers? Example:

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

推荐答案

在 Insiders' Build v1.54 中似乎有一些能力可以做到这一点,请参阅 功能:Shift Shift、Ctrl Ctrl、Alt Alt 键绑定(支持双击修饰符键绑定) .

Some ability to do this appears it is in the Insiders' Build v1.54, see 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"
}

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

NOTE : there is no + between the modifier keys, so

  "key": "shift+shift",

目前无法使用 - 已测试.

does not currently work - tested.

这篇关于如何在 VSCode 中创建仅由修饰符组成的键绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆