HotKeys.js 3.1.0 发布了,这是一个强健的 Javascript 库用于捕获键盘输入和输入的组合键,它没有依赖,压缩只有(3.62kb, gzipped: 1.73kb)。

更新内容

1. 修复新参数没有加入TypeScript类型文件中的问题。#59 da94c8b
2. 修改三个和两个键组合键的问题。 #55 efb4950

hotkeys('command+shift+z,command+z', function(event,handler) {
  console.log('handle', handler.key,  event)
});

3. 支持三个键组合的快捷键。#55 b0f5d3c

hotkeys('ctrl+a+s', function(event,handler) {
  if(handler.key === 'ctrl+a+s') {
    alert('you pressed ctrl+a+s!');
  }
});

4. 修复回调函数执行两次的问题。 #58 ada36f9
5. 参数options 添加 keyup 参数,支持弹起事件回调 #57
6. 修改unbind 解绑函数问题。 (#54@spencer516 d5f9360
7. 更新编译脚本. 982173d