@playcademy/sdk 0.0.1-beta.27 → 0.0.1-beta.29

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.
@@ -91,7 +91,13 @@ export declare enum MessageEvents {
91
91
  * Sent periodically for monitoring and analytics.
92
92
  * Payload: { fps: number, mem: number }
93
93
  */
94
- TELEMETRY = "PLAYCADEMY_TELEMETRY"
94
+ TELEMETRY = "PLAYCADEMY_TELEMETRY",
95
+ /**
96
+ * Game reports key events to parent.
97
+ * Sent when certain keys are pressed within the game iframe.
98
+ * Payload: { key: string, code?: string, type: 'keydown' | 'keyup' }
99
+ */
100
+ KEY_EVENT = "PLAYCADEMY_KEY_EVENT"
95
101
  }
96
102
  /**
97
103
  * Type definition for message handler functions.
@@ -141,6 +147,12 @@ export type MessageEventMap = {
141
147
  fps: number;
142
148
  mem: number;
143
149
  };
150
+ /** Key event data */
151
+ [MessageEvents.KEY_EVENT]: {
152
+ key: string;
153
+ code?: string;
154
+ type: 'keydown' | 'keyup';
155
+ };
144
156
  };
145
157
  /**
146
158
  * **PlaycademyMessaging Class**
package/dist/types.d.ts CHANGED
@@ -30,6 +30,7 @@ export type GameContextPayload = {
30
30
  token: string;
31
31
  baseUrl: string;
32
32
  gameId: string;
33
+ forwardKeys?: string[];
33
34
  };
34
35
  export type EventListeners = {
35
36
  [E in keyof ClientEvents]?: Array<(payload: ClientEvents[E]) => void>;