quake2ts 0.0.698 → 0.0.699

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quake2ts",
3
- "version": "0.0.698",
3
+ "version": "0.0.699",
4
4
  "description": "Quake II re-release port to TypeScript with WebGL renderer - A complete game engine with physics, networking, and BSP rendering",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ BrowserInputSource: () => BrowserInputSource,
33
34
  Cvar: () => import_engine2.Cvar,
34
35
  DLight: () => import_engine5.DLight,
35
36
  DynamicLightManager: () => import_engine5.DynamicLightManager,
@@ -2224,6 +2225,26 @@ var InputInjector = class {
2224
2225
  target.dispatchEvent(event);
2225
2226
  }
2226
2227
  };
2228
+ var BrowserInputSource = class {
2229
+ constructor(target = document) {
2230
+ this.target = target;
2231
+ }
2232
+ on(event, handler) {
2233
+ if (event === "keydown" || event === "keyup") {
2234
+ this.target.addEventListener(event, (e) => {
2235
+ handler(e.code);
2236
+ });
2237
+ } else if (event === "mousedown" || event === "mouseup") {
2238
+ this.target.addEventListener(event, (e) => {
2239
+ handler(e.button);
2240
+ });
2241
+ } else if (event === "mousemove") {
2242
+ this.target.addEventListener(event, (e) => {
2243
+ handler(e.movementX, e.movementY);
2244
+ });
2245
+ }
2246
+ }
2247
+ };
2227
2248
  function createMockPointerLock(element) {
2228
2249
  const mock = new MockPointerLock();
2229
2250
  if (element) {
@@ -5320,6 +5341,7 @@ function createVisualTestScenario(sceneName) {
5320
5341
  }
5321
5342
  // Annotate the CommonJS export names for ESM import in node:
5322
5343
  0 && (module.exports = {
5344
+ BrowserInputSource,
5323
5345
  Cvar,
5324
5346
  DLight,
5325
5347
  DynamicLightManager,