我想知道是否可以使用 macbook pro 用于音乐控制的特殊键并将它们绑定到 javascript 中?示例键:播放/暂停、下一个、返回。
如果有帮助,我正在尝试这样做来修改greasemonkey脚本。
这是当前代码
HotKeys.bindings['/'] = HotKeys.activateSearch;
HotKeys.bindings['p'] = HotKeys.playPrev;
HotKeys.bindings['n'] = HotKeys.playNext;
HotKeys.bindings['k'] = HotKeys.selectPrev;
HotKeys.bindings['j'] = HotKeys.selectNext;
HotKeys.bindings['o'] = HotKeys.playSelected;
HotKeys.bindings['v'] = HotKeys.openBlog;
HotKeys.bindings['s'] = HotKeys.toggleFavorite;
HotKeys.keyBindings[27] /*ESC*/ = HotKeys.deactivateSearch;