mage-engine 3.24.8 → 3.24.9

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.
Files changed (2) hide show
  1. package/dist/mage.js +6 -3
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -54480,12 +54480,14 @@ let Keyboard = /*#__PURE__*/function (_EventDispatcher) {
54480
54480
  });
54481
54481
  });
54482
54482
  _defineProperty$1(_this, "handleKeydown", event => {
54483
+ _this.pressedKeys.add(event.key.toLowerCase());
54483
54484
  _this.dispatchEvent({
54484
54485
  type: KEY_DOWN,
54485
54486
  event
54486
54487
  });
54487
54488
  });
54488
54489
  _defineProperty$1(_this, "handleKeyup", event => {
54490
+ _this.pressedKeys.delete(event.key.toLowerCase());
54489
54491
  _this.dispatchEvent({
54490
54492
  type: KEY_UP,
54491
54493
  event
@@ -54498,6 +54500,7 @@ let Keyboard = /*#__PURE__*/function (_EventDispatcher) {
54498
54500
  });
54499
54501
  });
54500
54502
  _this.combos = [];
54503
+ _this.pressedKeys = new Set();
54501
54504
  _this.enabled = false;
54502
54505
  return _this;
54503
54506
  }
@@ -54528,6 +54531,7 @@ let Keyboard = /*#__PURE__*/function (_EventDispatcher) {
54528
54531
  key: "disable",
54529
54532
  value: function disable() {
54530
54533
  this.enabled = false;
54534
+ this.pressedKeys.clear();
54531
54535
  hotkeys.unbind();
54532
54536
  window.removeEventListener(KEY_DOWN.toLowerCase(), this.handleKeydown.bind(this));
54533
54537
  window.removeEventListener(KEY_UP.toLowerCase(), this.handleKeyup.bind(this));
@@ -54536,8 +54540,7 @@ let Keyboard = /*#__PURE__*/function (_EventDispatcher) {
54536
54540
  }, {
54537
54541
  key: "isPressed",
54538
54542
  value: function isPressed(key) {
54539
- console.log(key, hotkeys.getPressedKeyCodes());
54540
- return hotkeys.isPressed(key);
54543
+ return this.pressedKeys.has(key.toLowerCase());
54541
54544
  }
54542
54545
  }]);
54543
54546
  }(EventDispatcher);const ENTITY_TYPES = {
@@ -58179,7 +58182,7 @@ function applyMiddleware() {
58179
58182
 
58180
58183
  var thunk = createThunkMiddleware();
58181
58184
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
58182
- var version$1 = "3.24.8";
58185
+ var version$1 = "3.24.9";
58183
58186
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
58184
58187
  var main = "dist/mage.js";
58185
58188
  var author$1 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.24.8",
3
+ "version": "3.24.9",
4
4
  "description": "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.",
5
5
  "main": "dist/mage.js",
6
6
  "author": {