【问题标题】:Change key binding for German umlauts in VSCode在 VSCode 中更改德语变音符号的键绑定
【发布时间】:2019-05-24 08:20:44
【问题描述】:

我喜欢在 VSCode 中使用键盘上的德语变音符号“ö”、“Ö”、“ä”和“Ä”进行编码,即使用这些键输入方括号和大括号。这是我在keybindings.json 中尝试过的:

{ "key": "ö",           "command": "type", "args": { "text": "[" }, "when": "editorTextFocus" },
{ "key": "ä",           "command": "type", "args": { "text": "]" }, "when": "editorTextFocus" },
{ "key": "Shift+ö",     "command": "type", "args": { "text": "{" }, "when": "editorTextFocus" },
{ "key": "Shift+ä",     "command": "type", "args": { "text": "}" }, "when": "editorTextFocus" },
{ "key": "Alt-ö",       "command": "type", "args": { "text": "ö" }, "when": "editorTextFocus" },
{ "key": "Alt-ä",       "command": "type", "args": { "text": "ä" }, "when": "editorTextFocus" },
{ "key": "Alt-Shift+ö", "command": "type", "args": { "text": "Ö" }, "when": "editorTextFocus" },
{ "key": "Alt-Shift+ä", "command": "type", "args": { "text": "Ä" }, "when": "editorTextFocus" }

VSCode 抱怨:

您将无法在当前的情况下生成此组合键 键盘布局。

有没有一种简单的方法可以教 VSCode 允许绑定任何键,而不仅仅是预定义的键?

【问题讨论】:

    标签: visual-studio-code vscode-settings key-bindings keyboard-layout


    【解决方案1】:

    这些都是允许的,毕竟预定义的“Toggle Integrated Terminal”快捷键是Ctrl+ö。你只是不能在 JSON 中直接写字符。

    我自己通常也更喜欢使用 JSON 编辑器,但这实际上是 UI 非常有用的情况。在“请输入所需的组合键”弹出窗口中,您可以看到使用 QWERTZ 键盘...

    • ...ö 转为oem_3
    • ...ä 转为oem_7
    • ...ü 转为oem_1

    【讨论】:

      【解决方案2】:

      感谢@Gama11 提供有关 UI 的提示。我试了一下,得到了[Semicolon][Quote][BracketLeft] 的键,用于我的德语键盘 + 布局的öäü

      这是我的工作keybindings.json

          { "key": "[Semicolon]",           "command": "type", "args": { "text": "[" }, "when": "editorTextFocus" },
          { "key": "[Quote]",               "command": "type", "args": { "text": "]" }, "when": "editorTextFocus" },
          { "key": "Shift+[Semicolon]",     "command": "type", "args": { "text": "{" }, "when": "editorTextFocus" },
          { "key": "Shift+[Quote]",         "command": "type", "args": { "text": "}" }, "when": "editorTextFocus" },
          { "key": "Alt+[Semicolon]",       "command": "type", "args": { "text": "ö" }, "when": "editorTextFocus" },
          { "key": "Alt+[Quote]",           "command": "type", "args": { "text": "ä" }, "when": "editorTextFocus" },
          { "key": "Shift+Alt+[Semicolon]", "command": "type", "args": { "text": "Ö" }, "when": "editorTextFocus" },
          { "key": "Shift+Alt+[Quote]",     "command": "type", "args": { "text": "Ä" }, "when": "editorTextFocus" }  
      

      它非常适合映射的元音变音键,并且不会干扰常规的 ;" 键。

      【讨论】:

      • 非常有用,谢谢。只有一件事:在您发布的代码中,Ö 和 Ä 在最后两行交换。不能自己编辑,因为编辑必须至少有 6 个字符(duh)。
      • @Neonit 是有意的。它们“Ö”在“Ä”的左边,使用上面的代码,它们被正确映射到[(左)和](右)和{(左)和}(右)跨度>
      • 不,我的意思是实际插入 ÄÖ 的额外绑定被交换了。您已将 Alt+[Semicolon] 绑定到 ö,但将 Shift+Alt+[Semicolon] 绑定到 Ä
      • ? 你是对的@Neonit!实际上,我从未在 VS Code 中使用过那个变音回退绑定,因为我没有用德语编码?。现在修好了。谢谢!
      猜你喜欢
      • 2020-10-11
      • 1970-01-01
      • 2021-09-28
      • 1970-01-01
      • 2016-01-21
      • 2013-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多