jQuery.Hotkeys - lets you watch for keyboard events anywhere in your code supporting almost any key combination

寻技术 JQuery 2023年07月11日 88

About

jQuery Hotkeys is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination.

The syntax is as follows:

$(expression).bind(types.keys, handler);
$(expression).unbind(types.keys, handler);

$(document).bind('keydown.ctrl_a', fn);

// e.g. replace '$' sign with 'EUR'
$('input.foo').bind('keyup.$', function(){
  this.value = this.value.replace('$', 'EUR');
});

 

Types

Supported types are 'keydown', 'keyup' and 'keypress'

 

 

Keyborads

https://rawgit.com/jeresig/jquery.hotkeys/master/test-static-01.html

 

Download

jquery.hotkeys.zip

 

关闭

用微信“扫一扫”