@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.umd.js CHANGED
@@ -834,8 +834,11 @@
834
834
  **/
835
835
  listenKeyboard(target, eventName = "keypress", callback, options) {
836
836
  let keyboardEventCallBack = function (event) {
837
+ /** 键名 */
837
838
  let keyName = event.key || event.code;
839
+ /** 键值 */
838
840
  let keyValue = event.charCode || event.keyCode || event.which;
841
+ /** 组合键列表 */
839
842
  let otherCodeList = [];
840
843
  if (event.ctrlKey) {
841
844
  otherCodeList.push("ctrl");
@@ -850,7 +853,7 @@
850
853
  otherCodeList.push("shift");
851
854
  }
852
855
  if (typeof callback === "function") {
853
- callback(keyName, keyValue.toString(), otherCodeList, event);
856
+ callback(keyName, keyValue, otherCodeList, event);
854
857
  }
855
858
  };
856
859
  this.on(target, eventName, keyboardEventCallBack, options);