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