Is there a way to write a greasemonkey script to register hotkeys?
Yes, I may have used scripts that used to rely on hotkeys. I'm not familiar with writing greasemonkey scripts, but since it's just JavaScript, I believe you can use jQuery and a plugin like this http://plugins.jquery.com/project/hotkeys . Using this plugin, doing what you want to do is as easy as
$(document).bind('keydown', 'Ctrl+M', fn);
a source to share
You can do this quite easily. You will need to add event listeners to the input (textarea?). Here's an event tester so you can figure out what keyboard event properties and values you're looking for: http://unixpapa.com/js/testkey.html
For example, control-shift-M gives you this keyup event in Firefox:
keyup keyCode=77 (M) which=77 (M) charCode=0
keyIdentifier=undefined keyLocation=undefined
shiftKey=true ctrlKey=true altKey=false metaKey=false
a source to share
If you need any documentation on how to use key events read the MDC documentation here . Basically, while you just want to add an event listener to an element document
or to some element of the document, then the event listener must determine if the desired keys (and only those keys) were pressed, if so, take the appropriate action.
a source to share