首页 > 解决方案 > 在 VSCode 中更改德语变音符号的键绑定

问题描述

我喜欢在我的键盘上使用德语变音符号“ö”、“Ö”、“ä”和“Ä”在 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-codevscode-settingskey-bindingskeyboard-layout

解决方案


这些都是允许的,毕竟预定义的“切换集成终端”快捷键是Ctrl+ 。ö您只是不能在 JSON 中按字面意思编写字符。

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

  • ...ö变成oem_3
  • ...ä变成oem_7
  • ...ü变成oem_1

推荐阅读