Keypress - 强大的键盘输入捕捉JavaScript库

jopen 11年前

Keypress是一个强大的键盘输入捕捉JavaScript库 。拥有一些非常特殊的功能,它非常容易上手和使用,大小只有9KB,并且不依赖其它JS框架。示例代码:

keypress.combo("shift s", function() {      console.log("You pressed shift and s");  });    // There are also a few other shortcut methods:    // If we want to register a counting combo  keypress.counting_combo("tab space", function(e, count) {      console.log("You've pressed this " + count + " times.");  });    // If you want to register a sequence combo  keypress.sequence_combo("up up down down left right left right b a enter", function() {      lives = 30;  }, true);

未标题-1.gif

项目主页:http://www.open-open.com/lib/view/home/1348798931119