如何在 Visual Studio Code 中调试键绑定 [英] How to debug keybinds in Visual Studio Code

查看:37
本文介绍了如何在 Visual Studio Code 中调试键绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取用于在 Visual Studio Code 中添加新光标的键绑定(Ctrl+Alt+DownArrow/UpArrow).目前按下这个组合键没有明显效果,但在我的命令面板中被列为创建新光标(并从命令面板中选择该选项按预期工作).

I am trying to get the keybind for adding new cursors to work in Visual Studio Code (Ctrl+Alt+DownArrow / UpArrow). Currently pressing this combination of keys has no obvious effect, but is listed in my command palette as creating new cursors (and selecting the option from the command palette works as expected).

因此,我想知道是否有一种简单的方法可以解决为什么它不起作用,例如编辑器接收到哪些组合键以及它在接收到组合键时执行哪些命令的输出?

Therefore I am wondering if there is an easy way to work out why it isn't working, for example an output of what key combinations the editor receives and what commands it carries out on receiving a key combination?

这是我所指的命令(注意从调色板中选择它如图所示),

Here is the command I am referring to (note that selecting it from palette works as shown),

推荐答案

您可以通过打开 Command Palette 并选择 Developer: Toggle Keyboard Shortcuts Troubleshooting

You can troubleshoot keybindings by opening the Command Palette and selecting Developer: Toggle Keyboard Shortcuts Troubleshooting

您可以在 VS Code 文档中阅读更多内容,

You can read more in the VS Code documentation,

要解决键绑定问题,您可以执行命令 Developer: Toggle Keyboard Shortcuts Troubleshooting.这将激活已调度键盘快捷键的日志记录,并会打开一个带有相应日志文件的输出面板.

To troubleshoot keybindings problems, you can execute the command Developer: Toggle Keyboard Shortcuts Troubleshooting. This will activate logging of dispatched keyboard shortcuts and will open an output panel with the corresponding log file.

然后,您可以按下所需的键绑定并检查 VS Code 检测到的键盘快捷键以及调用的命令.

You can then press your desired keybinding and check what keyboard shortcut VS Code detects and what command is invoked.

这篇关于如何在 Visual Studio Code 中调试键绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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