From 1fb586604816dc74c430efcb7d6f5e14ec16327e Mon Sep 17 00:00:00 2001 From: tujiawei Date: Mon, 9 Oct 2023 19:57:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md => README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) rename Readme.md => README.md (85%) diff --git a/Readme.md b/README.md similarity index 85% rename from Readme.md rename to README.md index 4c6f2cc..cba6a74 100644 --- a/Readme.md +++ b/README.md @@ -10,11 +10,11 @@ > 键盘 ```js -import Keyboard from 'http://unpkg.bytedo.org/@bytedo/keyboard/dist/index.js' +import { KeyboardV1, KeyboardV2 } from 'http://unpkg.bytedo.org/@bytedo/keyboard/dist/index.js' -var kb = new Keyboard() +var kb = new KeyboardV2() // 默认整个document监听, 也可以单独对局部起效 -// var kb = new Keyboard(document.querySelector('.foo')) +// var kb = new KeyboardV2(document.querySelector('.foo')) // 同时按Ctrl键和C键, 触发回调 kb.on(['ctrl + c'], ev => { @@ -113,9 +113,12 @@ kb.on(['ctrl + c', 'ctrl + v'], ev => { | Tab | tab | 制表符键 | | Cmd/Win | meta | Command/Win键(1.x版不区别左右) | | Space | space | 空格键 | -| Ctrl | ctrl | Ctrl键(1.x版不区分左右) | -| Shift | shift | Shift键(1.x版不区分左右) | -| Alt/Option| alt | Alt/Option键(1.x版不区分左右) | +| Ctrl(同shift) | ctrl | Ctrl键(1.x版不区分左右) | +| Shift | shift | Shift键(1.x) | +| Shift(left) | shift_left | 左侧Shift键(2.x) | +| Shift(right) | shift_right | 右侧Shift键(2.x) | +| Alt/Option(同shift) | alt/option | Alt/Option键(1.x版不区分左右) | +| Win/Cmd(同shift) | win/cmd | Win/Cmd(只存在于2.x版本) | | Enter | enter | 回车键(1.x版不区分小数字键盘的回车) | | ' | ' | 单引号键 | | * | * | 小数字键盘中的乘号 | @@ -128,5 +131,5 @@ kb.on(['ctrl + c', 'ctrl + v'], ev => { | = | = | 等号 | | [ | [ | 左边中括号 | | ] | ] | 右边中括号 | -| ` | ` | 反引号(Tab上面的键) | +| ` | ` | 反引号(Tab上面的键) || | \ | \ | 反斜杠 | \ No newline at end of file