Using special keys for keybidings in Javascript
- by newhen
Hi, I was wondering if it was possible to use special keys that the macbook pro has for music control and bind them in javascript?
Example keys: PLay/pause,next, back.
I am trying to do this to modify a greasemonkey script if that helps.
Here is the current code
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;
Script source: http://userscripts.org/scripts/review/23612