@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.amd.js
CHANGED
|
@@ -830,8 +830,11 @@ define((function () { 'use strict';
|
|
|
830
830
|
**/
|
|
831
831
|
listenKeyboard(target, eventName = "keypress", callback, options) {
|
|
832
832
|
let keyboardEventCallBack = function (event) {
|
|
833
|
+
/** 键名 */
|
|
833
834
|
let keyName = event.key || event.code;
|
|
835
|
+
/** 键值 */
|
|
834
836
|
let keyValue = event.charCode || event.keyCode || event.which;
|
|
837
|
+
/** 组合键列表 */
|
|
835
838
|
let otherCodeList = [];
|
|
836
839
|
if (event.ctrlKey) {
|
|
837
840
|
otherCodeList.push("ctrl");
|
|
@@ -846,7 +849,7 @@ define((function () { 'use strict';
|
|
|
846
849
|
otherCodeList.push("shift");
|
|
847
850
|
}
|
|
848
851
|
if (typeof callback === "function") {
|
|
849
|
-
callback(keyName, keyValue
|
|
852
|
+
callback(keyName, keyValue, otherCodeList, event);
|
|
850
853
|
}
|
|
851
854
|
};
|
|
852
855
|
this.on(target, eventName, keyboardEventCallBack, options);
|