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