@whitesev/domutils 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.amd.js +4 -1
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +4 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +4 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +4 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +4 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/DOMUtilsEvent.d.ts +1 -1
- package/package.json +1 -1
- package/src/DOMUtilsEvent.ts +7 -4
package/dist/index.esm.js
CHANGED
|
@@ -828,8 +828,11 @@ class DOMUtilsEvent {
|
|
|
828
828
|
**/
|
|
829
829
|
listenKeyboard(target, eventName = "keypress", callback, options) {
|
|
830
830
|
let keyboardEventCallBack = function (event) {
|
|
831
|
+
/** 键名 */
|
|
831
832
|
let keyName = event.key || event.code;
|
|
833
|
+
/** 键值 */
|
|
832
834
|
let keyValue = event.charCode || event.keyCode || event.which;
|
|
835
|
+
/** 组合键列表 */
|
|
833
836
|
let otherCodeList = [];
|
|
834
837
|
if (event.ctrlKey) {
|
|
835
838
|
otherCodeList.push("ctrl");
|
|
@@ -844,7 +847,7 @@ class DOMUtilsEvent {
|
|
|
844
847
|
otherCodeList.push("shift");
|
|
845
848
|
}
|
|
846
849
|
if (typeof callback === "function") {
|
|
847
|
-
callback(keyName, keyValue
|
|
850
|
+
callback(keyName, keyValue, otherCodeList, event);
|
|
848
851
|
}
|
|
849
852
|
};
|
|
850
853
|
this.on(target, eventName, keyboardEventCallBack, options);
|