捕获鼠标事件并将其注册为键盘快捷键

时间:2013-03-22 21:43:05

标签: google-chrome-extension

我正在通过chrome.commands.onCommand.addListener事件帮助我定义特定命令并将其绑定到组合键。

{
  "name": "My extension",
  ...
  "commands": {
    "toggle-feature-foo": {
      "suggested_key": {
        "default": "Ctrl+Shift+Y",
        "mac": "Command+Shift+Y"
      },
      "description": "Toggle feature foo"
    },
    "_execute_browser_action": {
      "suggested_key": {
        "windows": "Ctrl+Shift+Y",
        "mac": "Command+Shift+Y",
        "chromeos": "Ctrl+Shift+U",
        "linux": "Ctrl+Shift+J"
      }
    },
    "_execute_page_action": {
      "suggested_key": {
        "default": "Ctrl+E"
        "windows": "Alt+P",
        "mac": "Option+P",
      }
    }
  },
  ...
}

我的问题是,如何绑定组合键以注册其他组合键,而不是像tutorial所示启动browser_action.html。

例如:我想通过[Mouse Middle Click + P]注册Ctrl + P。

0 个答案:

没有答案