jQuery hotkeys plugin
It looks like what you'll want to do is add it in a separate js file in a module. Use hook_form_alter() or hook_form_FORM_ID_alter()and identify the form that you want the script run on. Then In hook_form_alter() use drupal_add_js(drupal_get_path('module', 'mymodule') . '/mymodule.js'); to add the JavaScript file to that page.

Also in hook_form_alter(), you'll want to identify the button you want to add this to and add a prefix and suffix markup to it.

$form['button']['#prefix'] = array('&lt;div class="my-button-class"&gt;');
$form['button']['#suffix'] = array('&lt;/div&gt;');


In the JavaScript file, where you see div.foo you'll want to enter the name of that div that you created on the button.

$('div.my-button-class').unbind('keydown', 'Ctrl+a', fn);


Also in hook_form_alter() you need to add a class to an input or button or whatever you are using.

$form['field']['#attributes'] = array('class' =&gt; array('my-other-class'));


For this, in the js file you need to replace:

$('input.my-other-class').bind('keyup', '$', function(){


EDIT: Note the input.class. If you're targeting a different type of element this will need to be changed accordingly. Same with div. class. I think you can also do IDs like input#my-input-id.