Keypress – 超强大!捕获键盘输入的 JavaScript 库

  Keypress 是一个强大的 JavaScript 库,用于捕获键盘输入。这是一个有非常特殊的功能的输入捕获库,它是很容易掌握和使用,并且不依赖第三方库。在网站开发中,经常会碰到需要处理键盘输入的场景,处理起来繁琐。现在有了这个键盘输入处理的库就很方便了。

您可能感兴趣的相关文章

 

 

使用示例:

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);

  

立即下载      效果演示

 

本文链接:Keypress – 超赞!捕获键盘输入的 JavaScript 库

编译来源:梦想天空 ◆ 关注前端开发技术 ◆ 分享网页设计资源

posted @ 2013-10-12 09:49  梦想天空(山边小溪)  阅读(3560)  评论(7编辑  收藏  举报