Keypress - 強大的鍵盤輸入捕捉JavaScript庫
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);</pre>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!