【问题标题】:Does VS Code have anything like Atom's addKeystrokeResolver?VS Code 有类似 Atom 的 addKeystrokeResolver 的东西吗?
【发布时间】:2017-06-18 00:17:34
【问题描述】:

Atom 有一个功能,允许您在 Atom 对它们进行任何操作之前拦截键盘输入事件并将它们转换为不同的键盘输入。这是 Atom 文档中的一个示例:

atom.keymaps.addKeystrokeResolver ({event}) ->
  if event.code is 'KeyG' and event.altKey and event.ctrlKey and event.type isnt 'keyup'
    return 'ctrl-@'

此代码使 Atom 将 ctrl-alt-g 视为 ctrl-@。

(见http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/#overriding-atoms-keyboard-layout-recognition

VS Code 有类似的吗?

【问题讨论】:

    标签: visual-studio-code atom-editor vscode-extensions


    【解决方案1】:

    看看 VSCode vim 扩展做了什么:https://github.com/VSCodeVim/Vim/blob/aa8d9549ac0d31b393a9346788f9a9a93187c222/extension.ts#L208

    它挂接并覆盖了 VSCode 的 type 命令。这是一个比 atom 的击键解析器级别更低的扩展点,但它可能会提供您正在寻找的内容

    【讨论】:

      猜你喜欢
      • 2017-07-15
      • 2014-09-22
      • 2010-11-29
      • 2020-03-26
      • 2011-10-18
      • 2023-03-09
      • 2011-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多