@omnipad/core 0.2.0-alpha.3 → 0.4.0
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/dist/chunk-FWW6DLM7.cjs +1 -0
- package/dist/chunk-K6RXCH3Q.mjs +1 -0
- package/dist/index-DRA1rw5_.d.cts +1047 -0
- package/dist/index-DRA1rw5_.d.ts +1047 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +1118 -0
- package/dist/index.d.ts +223 -1244
- package/dist/index.mjs +1 -1439
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +310 -0
- package/dist/utils/index.d.ts +310 -0
- package/dist/utils/index.mjs +1 -0
- package/package.json +27 -4
- package/dist/index.d.mts +0 -2139
- package/dist/index.js +0 -1516
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
import { I as ICoreEntity, V as Vec2, G as GamepadMappingConfig, a as ISpatial, b as IResettable, c as IConfigurable, d as IObservable, E as EntityType, A as AbstractRect, B as ButtonConfig, e as IPointerHandler, f as IProgrammatic, g as AbstractPointerEvent, D as DPadConfig, h as InputZoneConfig, i as IDependencyBindable, j as AnyFunction, J as JoystickConfig, k as BaseConfig, T as TargetZoneConfig, l as ISignalReceiver, m as InputActionSignal, n as TrackpadConfig } from './index-DRA1rw5_.cjs';
|
|
2
|
+
export { o as ACTION_TYPES, p as ActionMapping, q as AnchorPoint, r as AnyConfig, s as AnyEntityType, t as BuiltInActionType, C as CMP_TYPES, u as CONTEXT, v as ConfigTreeNode, F as FlatConfigItem, w as FlexibleLength, x as GamepadProfile, y as IIdentifiable, z as ILifecycle, H as InputActionType, K as KEYS, L as KeyMapping, M as LayoutBox, S as StageId, N as StandardButton, U as Unit, W as WidgetId, O as WidgetType, Z as ZoneId, P as ZoneType } from './index-DRA1rw5_.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface for the global Registry singleton.
|
|
6
|
+
*/
|
|
7
|
+
interface IRegistry {
|
|
8
|
+
/**
|
|
9
|
+
* Registers an entity into the system.
|
|
10
|
+
* Usually called during a component's constructor or onMounted lifecycle.
|
|
11
|
+
*
|
|
12
|
+
* @param entity - The logic entity instance to register.
|
|
13
|
+
*/
|
|
14
|
+
register(entity: ICoreEntity): void;
|
|
15
|
+
/**
|
|
16
|
+
* Unregisters an entity from the system.
|
|
17
|
+
* Usually called during a component's destroy or onUnmounted lifecycle.
|
|
18
|
+
*
|
|
19
|
+
* @param uid - The unique identifier of the entity.
|
|
20
|
+
*/
|
|
21
|
+
unregister(uid: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Queries an entity by its UID.
|
|
24
|
+
* Supports generics for easy type casting to specific logic types (e.g., ISignalReceiver).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // usually global ID like "$main-stage"
|
|
28
|
+
* const stage = Registry.getInstance().getEntity<TargetZoneCore>('$main-stage');
|
|
29
|
+
*
|
|
30
|
+
* @param uid - The unique identifier of the target entity.
|
|
31
|
+
* @returns The entity instance, or undefined if not found.
|
|
32
|
+
*/
|
|
33
|
+
getEntity<T extends ICoreEntity = ICoreEntity>(uid: string): T | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a flat array of all currently registered entities.
|
|
36
|
+
* Useful for global operations or full-profile backups.
|
|
37
|
+
*/
|
|
38
|
+
getAllEntities(): ICoreEntity[];
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves an entity and all its recursive descendants based on parentId relationships.
|
|
41
|
+
*
|
|
42
|
+
* @param rootUid - The UID of the entity to start the search from.
|
|
43
|
+
* @returns An array of entities belonging to the specified subtree (including the root).
|
|
44
|
+
*/
|
|
45
|
+
getEntitiesByRoot(rootUid: string): ICoreEntity[];
|
|
46
|
+
/**
|
|
47
|
+
* Recursively destroys an entity and all its descendants.
|
|
48
|
+
* Ensures all signals are cut off and instances are removed from the registry.
|
|
49
|
+
*
|
|
50
|
+
* @param rootUid - The Entity ID of the root node to be destroyed.
|
|
51
|
+
*/
|
|
52
|
+
destroyByRoot(rootUid: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Triggers the reset() method on all compatible entities.
|
|
55
|
+
* Essential for cutting off active input signals (e.g., stuck keys) during profile reloads.
|
|
56
|
+
*/
|
|
57
|
+
resetAll(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Clears all registered entities.
|
|
60
|
+
* Used for system resets or full application unmounts.
|
|
61
|
+
*/
|
|
62
|
+
clear(): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Metadata for basic pointer interaction.
|
|
67
|
+
* Shared by all interactable entities to track physical touch/mouse state.
|
|
68
|
+
*/
|
|
69
|
+
interface InteractionState {
|
|
70
|
+
/** Indicates if the component is currently being touched or clicked. */
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
/** The unique ID of the pointer being tracked, used for Pointer Capture. */
|
|
73
|
+
pointerId: number | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Logic-level state for button-type widgets.
|
|
77
|
+
* Handles the processed output after debouncing or toggle logic.
|
|
78
|
+
*/
|
|
79
|
+
interface ButtonLogicState {
|
|
80
|
+
/** The final logical state of the button (true = pressed). */
|
|
81
|
+
isPressed: boolean;
|
|
82
|
+
/** Numerical value representing pressure or analog depth, ranging from 0.0 to 1.0. */
|
|
83
|
+
value: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Logic-level state for axis-type or joystick widgets.
|
|
87
|
+
* Represents the normalized directional input.
|
|
88
|
+
*/
|
|
89
|
+
interface AxisLogicState {
|
|
90
|
+
/** Normalized direction vector where x and y range from -1.0 to 1.0. */
|
|
91
|
+
vector: {
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Runtime state for the Virtual Cursor within a TargetZone.
|
|
98
|
+
*/
|
|
99
|
+
interface CursorState {
|
|
100
|
+
/** Current position of the cursor as a percentage (0-100) relative to the stage. */
|
|
101
|
+
position: Vec2;
|
|
102
|
+
/** Visibility toggle based on movement or configuration. */
|
|
103
|
+
isVisible: boolean;
|
|
104
|
+
/** Indicates if a logical "Mouse Down" is currently active. */
|
|
105
|
+
isPointerDown: boolean;
|
|
106
|
+
/** A temporary flag used to trigger focus-reclaim visual feedback. */
|
|
107
|
+
isFocusReturning: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* State for managing dynamic/floating widgets within an InputZone.
|
|
111
|
+
*/
|
|
112
|
+
interface InputZoneState {
|
|
113
|
+
/** Indicates if a dynamic widget (e.g., a floating stick) is currently spawned. */
|
|
114
|
+
isDynamicActive: boolean;
|
|
115
|
+
/** The ID (UID) of the pointer that triggered the dynamic widget. */
|
|
116
|
+
dynamicPointerId: number | null;
|
|
117
|
+
/** The initial spawn coordinates of the dynamic widget (percentage 0-100). */
|
|
118
|
+
dynamicPosition: Vec2;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Basic state for Managed Layers.
|
|
122
|
+
*/
|
|
123
|
+
interface LayerState {
|
|
124
|
+
/** Visual hint for layout debugging or active selection. */
|
|
125
|
+
isHighlighted: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Combined state for Button components.
|
|
129
|
+
*/
|
|
130
|
+
interface ButtonState extends InteractionState, ButtonLogicState {
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Combined state for Keyboard Button components.
|
|
134
|
+
*/
|
|
135
|
+
interface KeyboardButtonState extends InteractionState, ButtonLogicState {
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Combined state for Mouse Button components.
|
|
139
|
+
*/
|
|
140
|
+
interface MouseButtonState extends InteractionState, ButtonLogicState {
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Combined state for Trackpad components.
|
|
144
|
+
*/
|
|
145
|
+
interface TrackpadState extends InteractionState, ButtonLogicState {
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Combined state for D-pad components.
|
|
149
|
+
*/
|
|
150
|
+
interface DPadState extends InteractionState, AxisLogicState {
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Combined state for Joystick components.
|
|
154
|
+
*/
|
|
155
|
+
interface JoystickState extends InteractionState, AxisLogicState, ButtonLogicState {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* GamepadManager
|
|
160
|
+
*
|
|
161
|
+
* A singleton service that polls the browser Gamepad API via requestAnimationFrame.
|
|
162
|
+
* It translates physical hardware inputs into programmatic signals sent to
|
|
163
|
+
* virtual entities registered in the system.
|
|
164
|
+
*
|
|
165
|
+
* Handles:
|
|
166
|
+
* 1. Button edge detection (Down/Up).
|
|
167
|
+
* 2. D-Pad to vector conversion.
|
|
168
|
+
* 3. Analog stick deadzone processing.
|
|
169
|
+
*/
|
|
170
|
+
declare class GamepadManager {
|
|
171
|
+
private isRunning;
|
|
172
|
+
private config;
|
|
173
|
+
private lastButtonStates;
|
|
174
|
+
private constructor();
|
|
175
|
+
/**
|
|
176
|
+
* Retrieves the global singleton instance of the GamepadManager.
|
|
177
|
+
*/
|
|
178
|
+
static getInstance(): GamepadManager;
|
|
179
|
+
/**
|
|
180
|
+
* Updates the current gamepad mapping configuration.
|
|
181
|
+
*
|
|
182
|
+
* @param config - The mapping of physical inputs to virtual component IDs (UID).
|
|
183
|
+
*/
|
|
184
|
+
setConfig(config: GamepadMappingConfig[]): void;
|
|
185
|
+
/** Return the current gamepad mapping configuration. */
|
|
186
|
+
getConfig(): Readonly<GamepadMappingConfig[] | null>;
|
|
187
|
+
/**
|
|
188
|
+
* Starts the polling loop and listens for gamepad connection events.
|
|
189
|
+
*/
|
|
190
|
+
start(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Stops the polling loop.
|
|
193
|
+
*/
|
|
194
|
+
stop(): void;
|
|
195
|
+
/**
|
|
196
|
+
* The core polling loop executing at the browser's refresh rate.
|
|
197
|
+
*/
|
|
198
|
+
private loop;
|
|
199
|
+
/**
|
|
200
|
+
* Process binary button inputs with edge detection.
|
|
201
|
+
*/
|
|
202
|
+
private processButtons;
|
|
203
|
+
/**
|
|
204
|
+
* Translates physical D-Pad buttons into a normalized vector.
|
|
205
|
+
*/
|
|
206
|
+
private processDPad;
|
|
207
|
+
/**
|
|
208
|
+
* Process analog stick movements with deadzone logic.
|
|
209
|
+
*/
|
|
210
|
+
private processAxes;
|
|
211
|
+
/**
|
|
212
|
+
* Locates a virtual entity and triggers its programmatic interface.
|
|
213
|
+
*
|
|
214
|
+
* @param uid - The Entity ID (UID) of the target.
|
|
215
|
+
* @param action - The type of trigger ('down', 'up', or 'vector').
|
|
216
|
+
* @param payload - Optional data for vector movements.
|
|
217
|
+
*/
|
|
218
|
+
private triggerVirtualEntity;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Global Input Manager Singleton.
|
|
223
|
+
*
|
|
224
|
+
* Responsible for monitoring global browser events (resize, blur, visibility)
|
|
225
|
+
* and coordinating system-wide resets to prevent stuck inputs.
|
|
226
|
+
*/
|
|
227
|
+
declare class InputManager {
|
|
228
|
+
/** Internal flag to prevent multiple event registrations */
|
|
229
|
+
private _isListening;
|
|
230
|
+
/** A throttled version of the reset logic */
|
|
231
|
+
private throttledReset;
|
|
232
|
+
private constructor();
|
|
233
|
+
/**
|
|
234
|
+
* Retrieves the global instance of the InputManager.
|
|
235
|
+
* Ensures uniqueness across multiple bundles or modules.
|
|
236
|
+
*/
|
|
237
|
+
static getInstance(): InputManager;
|
|
238
|
+
/**
|
|
239
|
+
* Manually triggers a system-wide input reset via Registry.
|
|
240
|
+
*/
|
|
241
|
+
private handleGlobalReset;
|
|
242
|
+
private handleResizeReset;
|
|
243
|
+
private handleBlurReset;
|
|
244
|
+
private handleVisibilityChangeReset;
|
|
245
|
+
/**
|
|
246
|
+
* Initializes global safety listeners.
|
|
247
|
+
* Should be called once at the root component lifecycle (e.g., VirtualLayer).
|
|
248
|
+
*/
|
|
249
|
+
init(): void;
|
|
250
|
+
/**
|
|
251
|
+
* Toggle full-screen state of the page.
|
|
252
|
+
* @param element Target HTMLElement
|
|
253
|
+
*/
|
|
254
|
+
toggleFullscreen(element?: HTMLElement): Promise<void>;
|
|
255
|
+
/**
|
|
256
|
+
* Full-screen status query provided to the UI layer.
|
|
257
|
+
*/
|
|
258
|
+
isFullscreen(): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Detaches all global listeners.
|
|
261
|
+
*/
|
|
262
|
+
destroy(): void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Global Registry Singleton.
|
|
267
|
+
*
|
|
268
|
+
* Acts as the "Census Bureau" for the system, maintaining references to all active
|
|
269
|
+
* logic entities (Stages, Widgets, Layers). It enables cross-component communication
|
|
270
|
+
* and coordinate mapping by allowing entities to look each other up via UIDs.
|
|
271
|
+
*/
|
|
272
|
+
declare class Registry implements IRegistry {
|
|
273
|
+
/** Internal storage: Mapping of Entity UID to Entity Instance */
|
|
274
|
+
private entities;
|
|
275
|
+
/**
|
|
276
|
+
* Private constructor to enforce singleton pattern.
|
|
277
|
+
*/
|
|
278
|
+
private constructor();
|
|
279
|
+
/**
|
|
280
|
+
* Retrieves the global instance of the Registry.
|
|
281
|
+
* Uses globalThis to ensure the instance is unique even if the library is loaded multiple times.
|
|
282
|
+
*/
|
|
283
|
+
static getInstance(): Registry;
|
|
284
|
+
register(entity: ICoreEntity): void;
|
|
285
|
+
unregister(uid: string): void;
|
|
286
|
+
getEntity<T extends ICoreEntity = ICoreEntity>(uid: string): T | undefined;
|
|
287
|
+
getAllEntities(): ICoreEntity[];
|
|
288
|
+
getEntitiesByRoot(rootUid: string): ICoreEntity[];
|
|
289
|
+
destroyByRoot(rootUid: string): void;
|
|
290
|
+
clear(): void;
|
|
291
|
+
resetAll(): void;
|
|
292
|
+
debugGetSnapshot(): Map<string, ICoreEntity>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Represents a callback function for the emitter.
|
|
297
|
+
* @template T - The type of data being broadcasted.
|
|
298
|
+
*/
|
|
299
|
+
type Listener<T> = (data: T) => void;
|
|
300
|
+
/**
|
|
301
|
+
* A lightweight implementation of the Observer pattern.
|
|
302
|
+
* Used primarily within Core Entities to notify the Adapter layer of state changes.
|
|
303
|
+
*
|
|
304
|
+
* @template T - The state or data object type.
|
|
305
|
+
*/
|
|
306
|
+
declare class SimpleEmitter<T> {
|
|
307
|
+
private listeners;
|
|
308
|
+
/**
|
|
309
|
+
* Registers a callback function to be executed whenever data is emitted.
|
|
310
|
+
*
|
|
311
|
+
* @param fn - The callback function.
|
|
312
|
+
* @returns A function that, when called, unsubscribes the listener.
|
|
313
|
+
*/
|
|
314
|
+
subscribe(fn: Listener<T>): () => void;
|
|
315
|
+
/**
|
|
316
|
+
* Broadcasts the provided data to all registered listeners.
|
|
317
|
+
* Each listener is executed within a try-catch block to ensure that
|
|
318
|
+
* an error in one subscriber doesn't prevent others from receiving the signal.
|
|
319
|
+
*
|
|
320
|
+
* @param data - The payload to be sent to all subscribers.
|
|
321
|
+
*/
|
|
322
|
+
emit(data: T): void;
|
|
323
|
+
/**
|
|
324
|
+
* Removes all listeners and clears the subscription set.
|
|
325
|
+
* Essential for preventing memory leaks when an Entity is destroyed.
|
|
326
|
+
*/
|
|
327
|
+
clear(): void;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Base abstract class for all logic entities in the system.
|
|
332
|
+
* Provides fundamental identity management, state subscription, and spatial awareness.
|
|
333
|
+
*/
|
|
334
|
+
declare abstract class BaseEntity<TConfig, TState> implements ICoreEntity, ISpatial, IResettable, IConfigurable<TConfig>, IObservable<TState> {
|
|
335
|
+
readonly uid: string;
|
|
336
|
+
readonly type: EntityType;
|
|
337
|
+
protected config: TConfig;
|
|
338
|
+
protected state: TState;
|
|
339
|
+
protected rectProvider: (() => AbstractRect) | null;
|
|
340
|
+
protected stateEmitter: SimpleEmitter<TState>;
|
|
341
|
+
constructor(uid: string, type: EntityType, initialConfig: TConfig, initialState: TState);
|
|
342
|
+
subscribe(cb: (state: TState) => void): () => void;
|
|
343
|
+
/**
|
|
344
|
+
* Updates the internal state and notifies all subscribers.
|
|
345
|
+
*
|
|
346
|
+
* @param partialState - Partial object containing updated state values.
|
|
347
|
+
*/
|
|
348
|
+
protected setState(partialState: Partial<TState>): void;
|
|
349
|
+
destroy(): void;
|
|
350
|
+
abstract reset(): void;
|
|
351
|
+
get rect(): AbstractRect | null;
|
|
352
|
+
bindRectProvider(provider: () => AbstractRect): void;
|
|
353
|
+
updateConfig(newConfig: Partial<TConfig>): void;
|
|
354
|
+
getState(): Readonly<TState>;
|
|
355
|
+
getConfig(): Readonly<TConfig>;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Core logic implementation for a button widget.
|
|
360
|
+
* Handles pointer interactions and translates them into keyboard signals for a target stage.
|
|
361
|
+
*/
|
|
362
|
+
declare class ButtonCore extends BaseEntity<ButtonConfig, ButtonState> implements IPointerHandler, IProgrammatic {
|
|
363
|
+
private emitter;
|
|
364
|
+
/**
|
|
365
|
+
* Creates an instance of KeyboardButtonCore.
|
|
366
|
+
*
|
|
367
|
+
* @param uid - The unique entity ID.
|
|
368
|
+
* @param config - The flat configuration object for the button.
|
|
369
|
+
*/
|
|
370
|
+
constructor(uid: string, config: ButtonConfig);
|
|
371
|
+
get activePointerId(): number | null;
|
|
372
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
373
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
374
|
+
onPointerCancel(): void;
|
|
375
|
+
onPointerMove(): void;
|
|
376
|
+
reset(): void;
|
|
377
|
+
updateConfig(newConfig: Partial<ButtonConfig>): void;
|
|
378
|
+
/**
|
|
379
|
+
* Clean up pointer capture and reset interaction state.
|
|
380
|
+
*/
|
|
381
|
+
private handleRelease;
|
|
382
|
+
triggerDown(): void;
|
|
383
|
+
triggerUp(): void;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Core logic for a virtual D-Pad widget.
|
|
388
|
+
*
|
|
389
|
+
* Acts as a spatial distributor that maps a single touch point to 4 independent ActionEmitters.
|
|
390
|
+
* Supports 8-way input by allowing simultaneous activation of orthogonal directions.
|
|
391
|
+
*/
|
|
392
|
+
declare class DPadCore extends BaseEntity<DPadConfig, DPadState> implements IPointerHandler, IProgrammatic {
|
|
393
|
+
private emitters;
|
|
394
|
+
private throttledPointerMove;
|
|
395
|
+
constructor(uid: string, config: DPadConfig);
|
|
396
|
+
get activePointerId(): number | null;
|
|
397
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
398
|
+
onPointerMove(e: AbstractPointerEvent): void;
|
|
399
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
400
|
+
onPointerCancel(): void;
|
|
401
|
+
/**
|
|
402
|
+
* Evaluates the touch position and updates the 4 emitters accordingly.
|
|
403
|
+
* 使用轴向分割逻辑处理 8 方向输入
|
|
404
|
+
*/
|
|
405
|
+
private processInput;
|
|
406
|
+
/**
|
|
407
|
+
* 将摇杆位置转换为 4/8 方向按键信号
|
|
408
|
+
*/
|
|
409
|
+
private handleDigitalKeys;
|
|
410
|
+
reset(): void;
|
|
411
|
+
updateConfig(newConfig: Partial<DPadConfig>): void;
|
|
412
|
+
triggerVector(x: number, y: number): void;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Logic core for InputZone.
|
|
417
|
+
*
|
|
418
|
+
* Manages a container for input widgets and handles the lifecycle of
|
|
419
|
+
* dynamic (floating) widgets when interacting with empty space.
|
|
420
|
+
*/
|
|
421
|
+
declare class InputZoneCore extends BaseEntity<InputZoneConfig, InputZoneState> implements IPointerHandler, IDependencyBindable {
|
|
422
|
+
private delegates;
|
|
423
|
+
constructor(uid: string, config: InputZoneConfig);
|
|
424
|
+
bindDelegate(key: string, delegate: AnyFunction): void;
|
|
425
|
+
get activePointerId(): number | null;
|
|
426
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
427
|
+
onPointerMove(e: AbstractPointerEvent): void;
|
|
428
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
429
|
+
onPointerCancel(e: AbstractPointerEvent): void;
|
|
430
|
+
/**
|
|
431
|
+
* Converts viewport pixels to percentage coordinates relative to the zone.
|
|
432
|
+
*/
|
|
433
|
+
private calculateRelativePosition;
|
|
434
|
+
/**
|
|
435
|
+
* Whether the interceptor layer should be enabled.
|
|
436
|
+
*/
|
|
437
|
+
get isInterceptorRequired(): boolean;
|
|
438
|
+
reset(): void;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Joystick Core Implementation.
|
|
443
|
+
*
|
|
444
|
+
* Supports dual-mode output:
|
|
445
|
+
* 1. Digital: Maps angles to 4/8-way key signals.
|
|
446
|
+
* 2. Analog/Cursor: Maps vector to continuous cursor movement via Tick mechanism.
|
|
447
|
+
*/
|
|
448
|
+
declare class JoystickCore extends BaseEntity<JoystickConfig, JoystickState> implements IPointerHandler, IProgrammatic {
|
|
449
|
+
private emitters;
|
|
450
|
+
private stickEmitter;
|
|
451
|
+
private cursorEmitter;
|
|
452
|
+
private gesture;
|
|
453
|
+
private ticker;
|
|
454
|
+
private throttledUpdate;
|
|
455
|
+
constructor(uid: string, config: JoystickConfig);
|
|
456
|
+
get activePointerId(): number | null;
|
|
457
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
458
|
+
onPointerMove(e: AbstractPointerEvent): void;
|
|
459
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
460
|
+
onPointerCancel(): void;
|
|
461
|
+
/**
|
|
462
|
+
* Clean up pointer capture and reset interaction state.
|
|
463
|
+
*/
|
|
464
|
+
private handleRelease;
|
|
465
|
+
/**
|
|
466
|
+
* 计算位移向量并驱动按键逻辑 / Calculate vector and drive key logic
|
|
467
|
+
*/
|
|
468
|
+
private processInput;
|
|
469
|
+
/**
|
|
470
|
+
* Ticker 回调:处理每帧的光标位移输出
|
|
471
|
+
*/
|
|
472
|
+
private handleCursorTick;
|
|
473
|
+
/**
|
|
474
|
+
* 将摇杆位置转换为 4/8 方向按键信号
|
|
475
|
+
*/
|
|
476
|
+
private handleDigitalKeys;
|
|
477
|
+
reset(): void;
|
|
478
|
+
updateConfig(newConfig: Partial<JoystickConfig>): void;
|
|
479
|
+
triggerDown(): void;
|
|
480
|
+
triggerUp(): void;
|
|
481
|
+
triggerVector(x: number, y: number): void;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Core logic for the Root/Managed Layer.
|
|
486
|
+
*
|
|
487
|
+
* Acts as the top-level container for a gamepad profile, providing the base
|
|
488
|
+
* identity (UID) and coordinate reference for all descendant components.
|
|
489
|
+
*/
|
|
490
|
+
declare class RootLayerCore extends BaseEntity<BaseConfig, LayerState> {
|
|
491
|
+
constructor(uid: string, config: BaseConfig);
|
|
492
|
+
reset(): void;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Core logic for the Target Focus Zone.
|
|
497
|
+
*
|
|
498
|
+
* It acts as a receiver that translates abstract input signals into native browser events,
|
|
499
|
+
* while maintaining virtual cursor positioning and ensuring the game maintains focus.
|
|
500
|
+
*/
|
|
501
|
+
declare class TargetZoneCore extends BaseEntity<TargetZoneConfig, CursorState> implements IPointerHandler, ISignalReceiver, IDependencyBindable {
|
|
502
|
+
private hideTimer;
|
|
503
|
+
private focusFeedbackTimer;
|
|
504
|
+
private throttledPointerMove;
|
|
505
|
+
private delegates;
|
|
506
|
+
constructor(uid: string, config: TargetZoneConfig);
|
|
507
|
+
bindDelegate(key: string, delegate: AnyFunction): void;
|
|
508
|
+
get activePointerId(): number | null;
|
|
509
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
510
|
+
onPointerMove(e: AbstractPointerEvent): void;
|
|
511
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
512
|
+
onPointerCancel(e: AbstractPointerEvent): void;
|
|
513
|
+
/**
|
|
514
|
+
* Convert physical DOM events into internal signals
|
|
515
|
+
*/
|
|
516
|
+
private processPhysicalEvent;
|
|
517
|
+
handleSignal(signal: InputActionSignal): void;
|
|
518
|
+
/**
|
|
519
|
+
* Calculates pixel coordinates and dispatches simulated pointer events to the deepest element.
|
|
520
|
+
*
|
|
521
|
+
* @param pointerType - The specific pointer event type (e.g., pointermove, pointerdown).
|
|
522
|
+
* @param payload - Data containing point coordinates or button info.
|
|
523
|
+
*/
|
|
524
|
+
private executeMouseAction;
|
|
525
|
+
/**
|
|
526
|
+
* Checks if the target element under the virtual cursor has focus, and reclaims it if lost.
|
|
527
|
+
*/
|
|
528
|
+
private ensureFocus;
|
|
529
|
+
/**
|
|
530
|
+
* Activates a temporary visual feedback state to indicate a focus-reclaim event.
|
|
531
|
+
*/
|
|
532
|
+
private triggerFocusFeedback;
|
|
533
|
+
/**
|
|
534
|
+
* Updates the internal virtual cursor coordinates.
|
|
535
|
+
*/
|
|
536
|
+
private updateCursorPosition;
|
|
537
|
+
/**
|
|
538
|
+
* Updates the internal virtual cursor coordinates by delta.
|
|
539
|
+
*/
|
|
540
|
+
private updateCursorPositionByDelta;
|
|
541
|
+
/**
|
|
542
|
+
* Makes the virtual cursor visible and sets a timeout for auto-hiding.
|
|
543
|
+
*/
|
|
544
|
+
private showCursor;
|
|
545
|
+
reset(): void;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Core logic implementation for a trackpad widget.
|
|
550
|
+
*
|
|
551
|
+
* Translates pointer gestures into relative mouse movements and click actions.
|
|
552
|
+
* Supports:
|
|
553
|
+
* - Single Tap: Dispatches a 'click' signal.
|
|
554
|
+
* - Swipe: Dispatches incremental 'mousemove' signals.
|
|
555
|
+
* - Double-tap and Hold: Enters drag mode (mousedown + mousemove).
|
|
556
|
+
*/
|
|
557
|
+
declare class TrackpadCore extends BaseEntity<TrackpadConfig, TrackpadState> implements IPointerHandler {
|
|
558
|
+
/** Stores the last processed client coordinates to calculate delta / 存储上次处理的客户端坐标以计算增量 */
|
|
559
|
+
private lastPointerPos;
|
|
560
|
+
private throttledPointerMove;
|
|
561
|
+
private gesture;
|
|
562
|
+
private emitter;
|
|
563
|
+
/**
|
|
564
|
+
* Creates an instance of TrackpadCore.
|
|
565
|
+
*
|
|
566
|
+
* @param uid - Unique entity ID.
|
|
567
|
+
* @param config - Configuration for the trackpad.
|
|
568
|
+
*/
|
|
569
|
+
constructor(uid: string, config: TrackpadConfig);
|
|
570
|
+
get activePointerId(): number | null;
|
|
571
|
+
onPointerDown(e: AbstractPointerEvent): void;
|
|
572
|
+
onPointerMove(e: AbstractPointerEvent): void;
|
|
573
|
+
/**
|
|
574
|
+
* Internal logic for processing pointer movement.
|
|
575
|
+
* Calculates displacement and emits relative move signals.
|
|
576
|
+
*
|
|
577
|
+
* @param e - The pointer event.
|
|
578
|
+
*/
|
|
579
|
+
private processPointerMove;
|
|
580
|
+
onPointerUp(e: AbstractPointerEvent): void;
|
|
581
|
+
onPointerCancel(): void;
|
|
582
|
+
reset(): void;
|
|
583
|
+
updateConfig(newConfig: Partial<TrackpadConfig>): void;
|
|
584
|
+
/**
|
|
585
|
+
* Clean up pointer capture and reset interaction state.
|
|
586
|
+
*/
|
|
587
|
+
private handleRelease;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
declare const OmniPad: {
|
|
591
|
+
ActionTypes: {
|
|
592
|
+
readonly KEYDOWN: "keydown";
|
|
593
|
+
readonly KEYUP: "keyup";
|
|
594
|
+
readonly POINTER: "pointer";
|
|
595
|
+
readonly POINTERMOVE: "pointermove";
|
|
596
|
+
readonly POINTERDOWN: "pointerdown";
|
|
597
|
+
readonly POINTERUP: "pointerup";
|
|
598
|
+
readonly MOUSE: "mouse";
|
|
599
|
+
readonly MOUSEMOVE: "mousemove";
|
|
600
|
+
readonly MOUSEDOWN: "mousedown";
|
|
601
|
+
readonly MOUSEUP: "mouseup";
|
|
602
|
+
readonly CLICK: "click";
|
|
603
|
+
};
|
|
604
|
+
Context: {
|
|
605
|
+
readonly PARENT_ID_KEY: "omnipad-parent-id-link";
|
|
606
|
+
};
|
|
607
|
+
Keys: {
|
|
608
|
+
readonly Backspace: {
|
|
609
|
+
readonly key: "Backspace";
|
|
610
|
+
readonly code: "Backspace";
|
|
611
|
+
readonly keyCode: 8;
|
|
612
|
+
};
|
|
613
|
+
readonly Tab: {
|
|
614
|
+
readonly key: "Tab";
|
|
615
|
+
readonly code: "Tab";
|
|
616
|
+
readonly keyCode: 9;
|
|
617
|
+
};
|
|
618
|
+
readonly Enter: {
|
|
619
|
+
readonly key: "Enter";
|
|
620
|
+
readonly code: "Enter";
|
|
621
|
+
readonly keyCode: 13;
|
|
622
|
+
};
|
|
623
|
+
readonly ShiftLeft: {
|
|
624
|
+
readonly key: "Shift";
|
|
625
|
+
readonly code: "ShiftLeft";
|
|
626
|
+
readonly keyCode: 16;
|
|
627
|
+
};
|
|
628
|
+
readonly ControlLeft: {
|
|
629
|
+
readonly key: "Control";
|
|
630
|
+
readonly code: "ControlLeft";
|
|
631
|
+
readonly keyCode: 17;
|
|
632
|
+
};
|
|
633
|
+
readonly AltLeft: {
|
|
634
|
+
readonly key: "Alt";
|
|
635
|
+
readonly code: "AltLeft";
|
|
636
|
+
readonly keyCode: 18;
|
|
637
|
+
};
|
|
638
|
+
readonly Pause: {
|
|
639
|
+
readonly key: "Pause";
|
|
640
|
+
readonly code: "Pause";
|
|
641
|
+
readonly keyCode: 19;
|
|
642
|
+
};
|
|
643
|
+
readonly CapsLock: {
|
|
644
|
+
readonly key: "CapsLock";
|
|
645
|
+
readonly code: "CapsLock";
|
|
646
|
+
readonly keyCode: 20;
|
|
647
|
+
};
|
|
648
|
+
readonly Escape: {
|
|
649
|
+
readonly key: "Escape";
|
|
650
|
+
readonly code: "Escape";
|
|
651
|
+
readonly keyCode: 27;
|
|
652
|
+
};
|
|
653
|
+
readonly Space: {
|
|
654
|
+
readonly key: " ";
|
|
655
|
+
readonly code: "Space";
|
|
656
|
+
readonly keyCode: 32;
|
|
657
|
+
};
|
|
658
|
+
readonly PageUp: {
|
|
659
|
+
readonly key: "PageUp";
|
|
660
|
+
readonly code: "PageUp";
|
|
661
|
+
readonly keyCode: 33;
|
|
662
|
+
};
|
|
663
|
+
readonly PageDown: {
|
|
664
|
+
readonly key: "PageDown";
|
|
665
|
+
readonly code: "PageDown";
|
|
666
|
+
readonly keyCode: 34;
|
|
667
|
+
};
|
|
668
|
+
readonly End: {
|
|
669
|
+
readonly key: "End";
|
|
670
|
+
readonly code: "End";
|
|
671
|
+
readonly keyCode: 35;
|
|
672
|
+
};
|
|
673
|
+
readonly Home: {
|
|
674
|
+
readonly key: "Home";
|
|
675
|
+
readonly code: "Home";
|
|
676
|
+
readonly keyCode: 36;
|
|
677
|
+
};
|
|
678
|
+
readonly ArrowLeft: {
|
|
679
|
+
readonly key: "ArrowLeft";
|
|
680
|
+
readonly code: "ArrowLeft";
|
|
681
|
+
readonly keyCode: 37;
|
|
682
|
+
};
|
|
683
|
+
readonly ArrowUp: {
|
|
684
|
+
readonly key: "ArrowUp";
|
|
685
|
+
readonly code: "ArrowUp";
|
|
686
|
+
readonly keyCode: 38;
|
|
687
|
+
};
|
|
688
|
+
readonly ArrowRight: {
|
|
689
|
+
readonly key: "ArrowRight";
|
|
690
|
+
readonly code: "ArrowRight";
|
|
691
|
+
readonly keyCode: 39;
|
|
692
|
+
};
|
|
693
|
+
readonly ArrowDown: {
|
|
694
|
+
readonly key: "ArrowDown";
|
|
695
|
+
readonly code: "ArrowDown";
|
|
696
|
+
readonly keyCode: 40;
|
|
697
|
+
};
|
|
698
|
+
readonly PrintScreen: {
|
|
699
|
+
readonly key: "PrintScreen";
|
|
700
|
+
readonly code: "PrintScreen";
|
|
701
|
+
readonly keyCode: 44;
|
|
702
|
+
};
|
|
703
|
+
readonly Insert: {
|
|
704
|
+
readonly key: "Insert";
|
|
705
|
+
readonly code: "Insert";
|
|
706
|
+
readonly keyCode: 45;
|
|
707
|
+
};
|
|
708
|
+
readonly Delete: {
|
|
709
|
+
readonly key: "Delete";
|
|
710
|
+
readonly code: "Delete";
|
|
711
|
+
readonly keyCode: 46;
|
|
712
|
+
};
|
|
713
|
+
readonly Digit0: {
|
|
714
|
+
readonly key: "0";
|
|
715
|
+
readonly code: "Digit0";
|
|
716
|
+
readonly keyCode: 48;
|
|
717
|
+
};
|
|
718
|
+
readonly Digit1: {
|
|
719
|
+
readonly key: "1";
|
|
720
|
+
readonly code: "Digit1";
|
|
721
|
+
readonly keyCode: 49;
|
|
722
|
+
};
|
|
723
|
+
readonly Digit2: {
|
|
724
|
+
readonly key: "2";
|
|
725
|
+
readonly code: "Digit2";
|
|
726
|
+
readonly keyCode: 50;
|
|
727
|
+
};
|
|
728
|
+
readonly Digit3: {
|
|
729
|
+
readonly key: "3";
|
|
730
|
+
readonly code: "Digit3";
|
|
731
|
+
readonly keyCode: 51;
|
|
732
|
+
};
|
|
733
|
+
readonly Digit4: {
|
|
734
|
+
readonly key: "4";
|
|
735
|
+
readonly code: "Digit4";
|
|
736
|
+
readonly keyCode: 52;
|
|
737
|
+
};
|
|
738
|
+
readonly Digit5: {
|
|
739
|
+
readonly key: "5";
|
|
740
|
+
readonly code: "Digit5";
|
|
741
|
+
readonly keyCode: 53;
|
|
742
|
+
};
|
|
743
|
+
readonly Digit6: {
|
|
744
|
+
readonly key: "6";
|
|
745
|
+
readonly code: "Digit6";
|
|
746
|
+
readonly keyCode: 54;
|
|
747
|
+
};
|
|
748
|
+
readonly Digit7: {
|
|
749
|
+
readonly key: "7";
|
|
750
|
+
readonly code: "Digit7";
|
|
751
|
+
readonly keyCode: 55;
|
|
752
|
+
};
|
|
753
|
+
readonly Digit8: {
|
|
754
|
+
readonly key: "8";
|
|
755
|
+
readonly code: "Digit8";
|
|
756
|
+
readonly keyCode: 56;
|
|
757
|
+
};
|
|
758
|
+
readonly Digit9: {
|
|
759
|
+
readonly key: "9";
|
|
760
|
+
readonly code: "Digit9";
|
|
761
|
+
readonly keyCode: 57;
|
|
762
|
+
};
|
|
763
|
+
readonly KeyA: {
|
|
764
|
+
readonly key: "a";
|
|
765
|
+
readonly code: "KeyA";
|
|
766
|
+
readonly keyCode: 65;
|
|
767
|
+
};
|
|
768
|
+
readonly KeyB: {
|
|
769
|
+
readonly key: "b";
|
|
770
|
+
readonly code: "KeyB";
|
|
771
|
+
readonly keyCode: 66;
|
|
772
|
+
};
|
|
773
|
+
readonly KeyC: {
|
|
774
|
+
readonly key: "c";
|
|
775
|
+
readonly code: "KeyC";
|
|
776
|
+
readonly keyCode: 67;
|
|
777
|
+
};
|
|
778
|
+
readonly KeyD: {
|
|
779
|
+
readonly key: "d";
|
|
780
|
+
readonly code: "KeyD";
|
|
781
|
+
readonly keyCode: 68;
|
|
782
|
+
};
|
|
783
|
+
readonly KeyE: {
|
|
784
|
+
readonly key: "e";
|
|
785
|
+
readonly code: "KeyE";
|
|
786
|
+
readonly keyCode: 69;
|
|
787
|
+
};
|
|
788
|
+
readonly KeyF: {
|
|
789
|
+
readonly key: "f";
|
|
790
|
+
readonly code: "KeyF";
|
|
791
|
+
readonly keyCode: 70;
|
|
792
|
+
};
|
|
793
|
+
readonly KeyG: {
|
|
794
|
+
readonly key: "g";
|
|
795
|
+
readonly code: "KeyG";
|
|
796
|
+
readonly keyCode: 71;
|
|
797
|
+
};
|
|
798
|
+
readonly KeyH: {
|
|
799
|
+
readonly key: "h";
|
|
800
|
+
readonly code: "KeyH";
|
|
801
|
+
readonly keyCode: 72;
|
|
802
|
+
};
|
|
803
|
+
readonly KeyI: {
|
|
804
|
+
readonly key: "i";
|
|
805
|
+
readonly code: "KeyI";
|
|
806
|
+
readonly keyCode: 73;
|
|
807
|
+
};
|
|
808
|
+
readonly KeyJ: {
|
|
809
|
+
readonly key: "j";
|
|
810
|
+
readonly code: "KeyJ";
|
|
811
|
+
readonly keyCode: 74;
|
|
812
|
+
};
|
|
813
|
+
readonly KeyK: {
|
|
814
|
+
readonly key: "k";
|
|
815
|
+
readonly code: "KeyK";
|
|
816
|
+
readonly keyCode: 75;
|
|
817
|
+
};
|
|
818
|
+
readonly KeyL: {
|
|
819
|
+
readonly key: "l";
|
|
820
|
+
readonly code: "KeyL";
|
|
821
|
+
readonly keyCode: 76;
|
|
822
|
+
};
|
|
823
|
+
readonly KeyM: {
|
|
824
|
+
readonly key: "m";
|
|
825
|
+
readonly code: "KeyM";
|
|
826
|
+
readonly keyCode: 77;
|
|
827
|
+
};
|
|
828
|
+
readonly KeyN: {
|
|
829
|
+
readonly key: "n";
|
|
830
|
+
readonly code: "KeyN";
|
|
831
|
+
readonly keyCode: 78;
|
|
832
|
+
};
|
|
833
|
+
readonly KeyO: {
|
|
834
|
+
readonly key: "o";
|
|
835
|
+
readonly code: "KeyO";
|
|
836
|
+
readonly keyCode: 79;
|
|
837
|
+
};
|
|
838
|
+
readonly KeyP: {
|
|
839
|
+
readonly key: "p";
|
|
840
|
+
readonly code: "KeyP";
|
|
841
|
+
readonly keyCode: 80;
|
|
842
|
+
};
|
|
843
|
+
readonly KeyQ: {
|
|
844
|
+
readonly key: "q";
|
|
845
|
+
readonly code: "KeyQ";
|
|
846
|
+
readonly keyCode: 81;
|
|
847
|
+
};
|
|
848
|
+
readonly KeyR: {
|
|
849
|
+
readonly key: "r";
|
|
850
|
+
readonly code: "KeyR";
|
|
851
|
+
readonly keyCode: 82;
|
|
852
|
+
};
|
|
853
|
+
readonly KeyS: {
|
|
854
|
+
readonly key: "s";
|
|
855
|
+
readonly code: "KeyS";
|
|
856
|
+
readonly keyCode: 83;
|
|
857
|
+
};
|
|
858
|
+
readonly KeyT: {
|
|
859
|
+
readonly key: "t";
|
|
860
|
+
readonly code: "KeyT";
|
|
861
|
+
readonly keyCode: 84;
|
|
862
|
+
};
|
|
863
|
+
readonly KeyU: {
|
|
864
|
+
readonly key: "u";
|
|
865
|
+
readonly code: "KeyU";
|
|
866
|
+
readonly keyCode: 85;
|
|
867
|
+
};
|
|
868
|
+
readonly KeyV: {
|
|
869
|
+
readonly key: "v";
|
|
870
|
+
readonly code: "KeyV";
|
|
871
|
+
readonly keyCode: 86;
|
|
872
|
+
};
|
|
873
|
+
readonly KeyW: {
|
|
874
|
+
readonly key: "w";
|
|
875
|
+
readonly code: "KeyW";
|
|
876
|
+
readonly keyCode: 87;
|
|
877
|
+
};
|
|
878
|
+
readonly KeyX: {
|
|
879
|
+
readonly key: "x";
|
|
880
|
+
readonly code: "KeyX";
|
|
881
|
+
readonly keyCode: 88;
|
|
882
|
+
};
|
|
883
|
+
readonly KeyY: {
|
|
884
|
+
readonly key: "y";
|
|
885
|
+
readonly code: "KeyY";
|
|
886
|
+
readonly keyCode: 89;
|
|
887
|
+
};
|
|
888
|
+
readonly KeyZ: {
|
|
889
|
+
readonly key: "z";
|
|
890
|
+
readonly code: "KeyZ";
|
|
891
|
+
readonly keyCode: 90;
|
|
892
|
+
};
|
|
893
|
+
readonly MetaLeft: {
|
|
894
|
+
readonly key: "Meta";
|
|
895
|
+
readonly code: "MetaLeft";
|
|
896
|
+
readonly keyCode: 91;
|
|
897
|
+
};
|
|
898
|
+
readonly ContextMenu: {
|
|
899
|
+
readonly key: "ContextMenu";
|
|
900
|
+
readonly code: "ContextMenu";
|
|
901
|
+
readonly keyCode: 93;
|
|
902
|
+
};
|
|
903
|
+
readonly Numpad0: {
|
|
904
|
+
readonly key: "0";
|
|
905
|
+
readonly code: "Numpad0";
|
|
906
|
+
readonly keyCode: 96;
|
|
907
|
+
};
|
|
908
|
+
readonly Numpad1: {
|
|
909
|
+
readonly key: "1";
|
|
910
|
+
readonly code: "Numpad1";
|
|
911
|
+
readonly keyCode: 97;
|
|
912
|
+
};
|
|
913
|
+
readonly Numpad2: {
|
|
914
|
+
readonly key: "2";
|
|
915
|
+
readonly code: "Numpad2";
|
|
916
|
+
readonly keyCode: 98;
|
|
917
|
+
};
|
|
918
|
+
readonly Numpad3: {
|
|
919
|
+
readonly key: "3";
|
|
920
|
+
readonly code: "Numpad3";
|
|
921
|
+
readonly keyCode: 99;
|
|
922
|
+
};
|
|
923
|
+
readonly Numpad4: {
|
|
924
|
+
readonly key: "4";
|
|
925
|
+
readonly code: "Numpad4";
|
|
926
|
+
readonly keyCode: 100;
|
|
927
|
+
};
|
|
928
|
+
readonly Numpad5: {
|
|
929
|
+
readonly key: "5";
|
|
930
|
+
readonly code: "Numpad5";
|
|
931
|
+
readonly keyCode: 101;
|
|
932
|
+
};
|
|
933
|
+
readonly Numpad6: {
|
|
934
|
+
readonly key: "6";
|
|
935
|
+
readonly code: "Numpad6";
|
|
936
|
+
readonly keyCode: 102;
|
|
937
|
+
};
|
|
938
|
+
readonly Numpad7: {
|
|
939
|
+
readonly key: "7";
|
|
940
|
+
readonly code: "Numpad7";
|
|
941
|
+
readonly keyCode: 103;
|
|
942
|
+
};
|
|
943
|
+
readonly Numpad8: {
|
|
944
|
+
readonly key: "8";
|
|
945
|
+
readonly code: "Numpad8";
|
|
946
|
+
readonly keyCode: 104;
|
|
947
|
+
};
|
|
948
|
+
readonly Numpad9: {
|
|
949
|
+
readonly key: "9";
|
|
950
|
+
readonly code: "Numpad9";
|
|
951
|
+
readonly keyCode: 105;
|
|
952
|
+
};
|
|
953
|
+
readonly NumpadMultiply: {
|
|
954
|
+
readonly key: "*";
|
|
955
|
+
readonly code: "NumpadMultiply";
|
|
956
|
+
readonly keyCode: 106;
|
|
957
|
+
};
|
|
958
|
+
readonly NumpadAdd: {
|
|
959
|
+
readonly key: "+";
|
|
960
|
+
readonly code: "NumpadAdd";
|
|
961
|
+
readonly keyCode: 107;
|
|
962
|
+
};
|
|
963
|
+
readonly NumpadSubtract: {
|
|
964
|
+
readonly key: "-";
|
|
965
|
+
readonly code: "NumpadSubtract";
|
|
966
|
+
readonly keyCode: 109;
|
|
967
|
+
};
|
|
968
|
+
readonly NumpadDecimal: {
|
|
969
|
+
readonly key: ".";
|
|
970
|
+
readonly code: "NumpadDecimal";
|
|
971
|
+
readonly keyCode: 110;
|
|
972
|
+
};
|
|
973
|
+
readonly NumpadDivide: {
|
|
974
|
+
readonly key: "/";
|
|
975
|
+
readonly code: "NumpadDivide";
|
|
976
|
+
readonly keyCode: 111;
|
|
977
|
+
};
|
|
978
|
+
readonly F1: {
|
|
979
|
+
readonly key: "F1";
|
|
980
|
+
readonly code: "F1";
|
|
981
|
+
readonly keyCode: 112;
|
|
982
|
+
};
|
|
983
|
+
readonly F2: {
|
|
984
|
+
readonly key: "F2";
|
|
985
|
+
readonly code: "F2";
|
|
986
|
+
readonly keyCode: 113;
|
|
987
|
+
};
|
|
988
|
+
readonly F3: {
|
|
989
|
+
readonly key: "F3";
|
|
990
|
+
readonly code: "F3";
|
|
991
|
+
readonly keyCode: 114;
|
|
992
|
+
};
|
|
993
|
+
readonly F4: {
|
|
994
|
+
readonly key: "F4";
|
|
995
|
+
readonly code: "F4";
|
|
996
|
+
readonly keyCode: 115;
|
|
997
|
+
};
|
|
998
|
+
readonly F5: {
|
|
999
|
+
readonly key: "F5";
|
|
1000
|
+
readonly code: "F5";
|
|
1001
|
+
readonly keyCode: 116;
|
|
1002
|
+
};
|
|
1003
|
+
readonly F6: {
|
|
1004
|
+
readonly key: "F6";
|
|
1005
|
+
readonly code: "F6";
|
|
1006
|
+
readonly keyCode: 117;
|
|
1007
|
+
};
|
|
1008
|
+
readonly F7: {
|
|
1009
|
+
readonly key: "F7";
|
|
1010
|
+
readonly code: "F7";
|
|
1011
|
+
readonly keyCode: 118;
|
|
1012
|
+
};
|
|
1013
|
+
readonly F8: {
|
|
1014
|
+
readonly key: "F8";
|
|
1015
|
+
readonly code: "F8";
|
|
1016
|
+
readonly keyCode: 119;
|
|
1017
|
+
};
|
|
1018
|
+
readonly F9: {
|
|
1019
|
+
readonly key: "F9";
|
|
1020
|
+
readonly code: "F9";
|
|
1021
|
+
readonly keyCode: 120;
|
|
1022
|
+
};
|
|
1023
|
+
readonly F10: {
|
|
1024
|
+
readonly key: "F10";
|
|
1025
|
+
readonly code: "F10";
|
|
1026
|
+
readonly keyCode: 121;
|
|
1027
|
+
};
|
|
1028
|
+
readonly F11: {
|
|
1029
|
+
readonly key: "F11";
|
|
1030
|
+
readonly code: "F11";
|
|
1031
|
+
readonly keyCode: 122;
|
|
1032
|
+
};
|
|
1033
|
+
readonly F12: {
|
|
1034
|
+
readonly key: "F12";
|
|
1035
|
+
readonly code: "F12";
|
|
1036
|
+
readonly keyCode: 123;
|
|
1037
|
+
};
|
|
1038
|
+
readonly NumLock: {
|
|
1039
|
+
readonly key: "NumLock";
|
|
1040
|
+
readonly code: "NumLock";
|
|
1041
|
+
readonly keyCode: 144;
|
|
1042
|
+
};
|
|
1043
|
+
readonly ScrollLock: {
|
|
1044
|
+
readonly key: "ScrollLock";
|
|
1045
|
+
readonly code: "ScrollLock";
|
|
1046
|
+
readonly keyCode: 145;
|
|
1047
|
+
};
|
|
1048
|
+
readonly Semicolon: {
|
|
1049
|
+
readonly key: ";";
|
|
1050
|
+
readonly code: "Semicolon";
|
|
1051
|
+
readonly keyCode: 186;
|
|
1052
|
+
};
|
|
1053
|
+
readonly Equal: {
|
|
1054
|
+
readonly key: "=";
|
|
1055
|
+
readonly code: "Equal";
|
|
1056
|
+
readonly keyCode: 187;
|
|
1057
|
+
};
|
|
1058
|
+
readonly Comma: {
|
|
1059
|
+
readonly key: ",";
|
|
1060
|
+
readonly code: "Comma";
|
|
1061
|
+
readonly keyCode: 188;
|
|
1062
|
+
};
|
|
1063
|
+
readonly Minus: {
|
|
1064
|
+
readonly key: "-";
|
|
1065
|
+
readonly code: "Minus";
|
|
1066
|
+
readonly keyCode: 189;
|
|
1067
|
+
};
|
|
1068
|
+
readonly Period: {
|
|
1069
|
+
readonly key: ".";
|
|
1070
|
+
readonly code: "Period";
|
|
1071
|
+
readonly keyCode: 190;
|
|
1072
|
+
};
|
|
1073
|
+
readonly Slash: {
|
|
1074
|
+
readonly key: "/";
|
|
1075
|
+
readonly code: "Slash";
|
|
1076
|
+
readonly keyCode: 191;
|
|
1077
|
+
};
|
|
1078
|
+
readonly Backquote: {
|
|
1079
|
+
readonly key: "`";
|
|
1080
|
+
readonly code: "Backquote";
|
|
1081
|
+
readonly keyCode: 192;
|
|
1082
|
+
};
|
|
1083
|
+
readonly BracketLeft: {
|
|
1084
|
+
readonly key: "[";
|
|
1085
|
+
readonly code: "BracketLeft";
|
|
1086
|
+
readonly keyCode: 219;
|
|
1087
|
+
};
|
|
1088
|
+
readonly Backslash: {
|
|
1089
|
+
readonly key: "\\";
|
|
1090
|
+
readonly code: "Backslash";
|
|
1091
|
+
readonly keyCode: 220;
|
|
1092
|
+
};
|
|
1093
|
+
readonly BracketRight: {
|
|
1094
|
+
readonly key: "]";
|
|
1095
|
+
readonly code: "BracketRight";
|
|
1096
|
+
readonly keyCode: 221;
|
|
1097
|
+
};
|
|
1098
|
+
readonly Quote: {
|
|
1099
|
+
readonly key: "'";
|
|
1100
|
+
readonly code: "Quote";
|
|
1101
|
+
readonly keyCode: 222;
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
Types: {
|
|
1105
|
+
readonly INPUT_ZONE: "input-zone";
|
|
1106
|
+
readonly TARGET_ZONE: "target-zone";
|
|
1107
|
+
readonly BUTTON: "button";
|
|
1108
|
+
readonly KEYBOARD_BUTTON: "keyboard-button";
|
|
1109
|
+
readonly MOUSE_BUTTON: "mouse-button";
|
|
1110
|
+
readonly JOYSTICK: "joystick";
|
|
1111
|
+
readonly D_PAD: "d-pad";
|
|
1112
|
+
readonly TRACKPAD: "trackpad";
|
|
1113
|
+
readonly VIRTUAL_CURSOR: "virtual-cursor";
|
|
1114
|
+
readonly ROOT_LAYER: "root-layer";
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
export { AbstractPointerEvent, AbstractRect, AnyFunction, type AxisLogicState, BaseConfig, BaseEntity, ButtonConfig, ButtonCore, type ButtonLogicState, type ButtonState, type CursorState, DPadConfig, DPadCore, type DPadState, EntityType, GamepadManager, GamepadMappingConfig, IConfigurable, ICoreEntity, IDependencyBindable, IObservable, IPointerHandler, IProgrammatic, type IRegistry, IResettable, ISignalReceiver, ISpatial, InputActionSignal, InputManager, InputZoneConfig, InputZoneCore, type InputZoneState, type InteractionState, JoystickConfig, JoystickCore, type JoystickState, type KeyboardButtonState, type LayerState, type MouseButtonState, OmniPad, Registry, RootLayerCore, TargetZoneConfig, TargetZoneCore, TrackpadConfig, TrackpadCore, type TrackpadState, Vec2 };
|