添加键盘快捷方式以执行Chrome扩展程序 [英] Adding keyboard shortcuts to execute Chrome extension

查看:123
本文介绍了添加键盘快捷方式以执行Chrome扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个chrome扩展程序,希望使用键盘快捷键执行该扩展程序.

I have created a chrome extension which I'd like to cause execution using a keyboard shortcut.

摘要:

"suggested_key": {
  "default": "Ctrl+Shift+F"

我尝试了不同的组合,例如"Ctrl + Shift + A","Ctrl + Shift + D","Alt + X"和"Space + B"

I've tried different combinations such as "Ctrl+Shift+A", "Ctrl+Shift+D", "Alt+X" and "Space+B"

这些似乎都不起作用.我拼错了Alt或Space吗?

None of these seems to work. Am I spelling out Alt or Space wrong?

推荐答案

仅当没有其他操作绑定到同一键盘快捷键时,manifest文件中的建议键才有效.

The suggested key from your manifest file works only if there is no other action bound to the same keyboard shortcut.

文档:

用户可以使用中的UI随意将任何快捷方式指定为全局快捷方式 chrome://extensions \ Keyboard快捷键,但扩展程序开发人员 仅限于仅将Ctrl + Shift + [0..9]指定为全局快捷方式. 这是为了最大程度地降低覆盖其他快捷方式的风险 申请,因为例如,如果允许Alt + P 全局,则打印快捷方式可能无法在其他应用程序中使用.

The user is free to designate any shortcut as global using the UI in chrome://extensions \ Keyboard Shortcuts, but the extension developer is limited to specifying only Ctrl+Shift+[0..9] as global shortcuts. This is to minimize the risk of overriding shortcuts in other applications since if, for example, Alt+P were to be allowed as global, the printing shortcut might not work in other applications.

因此,Ctrl+Shift+F是Chrome的View菜单中的设置.您需要手动覆盖它或找到另一个快捷方式.

So, Ctrl+Shift+F it's a setting in a View menu of the Chrome. You need to override it manually or find another shortcut.

此外,您需要重新安装扩展程序以从清单激活新的快捷方式.

Also, you need to re-install your extension to activating a new shortcut from the manifest.

这篇关于添加键盘快捷方式以执行Chrome扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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