keymaster.js的使用(前端键盘快捷键)

来源:互联网 发布:厦门网络爬虫 编辑:程序博客网 时间:2024/05/16 07:39

1>像往常一样,引入keymaster.js文件到你的项目中。
2>

定义快捷键

key('a', function(){ alert('you pressed a!') });// returning false stops the event and prevents default browser eventskey('ctrl+r', function(){ alert('stopped reload!'); return false });// multiple shortcuts that do the same thingkey('⌘+r, ctrl+r', function(){ });
0 0