2

キーボード ショートカットを Chrome 拡張機能に実装しようとしています。

私はこれを管理しましたが、上部にある数字ではなくテンキーを使用するキーボードショートカットが欲しいです (まあ、それに加えて)。

以下は私のマニフェストとスクリプトです。

おそらく、これは Chrome コマンドの制限です。

マニフェスト.json

{
    "name": "Shortcut Test",
    "version": "1",
    "manifest_version": 2,
    "background": {"scripts": ["background.js"]},
    "commands": {
        "shortcut_test": {
            "suggested_key": {
                "default": "Ctrl+0",
        "windows": "Ctrl+0"
            },
            "description": "A test shortcut"
        }
    }
}

background.js

chrome.commands.onCommand.addListener(function(command){
    console.log(command);
});
4

1 に答える 1

3

はい、現在、コマンドのキー選択は非常に限られています。普通の文字と数字です。

于 2013-06-14T13:46:45.613 に答える