完成Readme

master
宇天 2020-11-03 18:05:23 +08:00
parent 6c907b4e6d
commit ac19e53857
2 changed files with 19 additions and 1 deletions

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "@bytedo/keyboard",
"version": "1.0.0",
"description": "支持各种按钮组合。原生js开发, 无任何依赖(不到2KB)。使用也非常简单。",
"main": "dist/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/bytedo/keyboard.git"
},
"keywords": ["keyboard", "hotkey", "shortcut", "yutent"],
"author": "yutent",
"license": "MIT",
"dependencies": {}
}

View File

@ -28,7 +28,11 @@ function hide(target, name, value) {
function check(ev) {
var checked = false
if (typeof this.keys.key === 'object') {
checked = this.keys.key.includes(ev.keyCode)
} else {
checked = ev.keyCode === this.keys.key
}
if (checked) {
for (let k of this.keys) {