@omnipad/core 0.4.5 → 0.6.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.
@@ -28,32 +28,10 @@ interface GamepadMappingConfig {
28
28
  }
29
29
 
30
30
  /**
31
- * Interface defining the structure of a keyboard key mapping.
31
+ * Interface defining the structure of key mapping.
32
32
  * Ensures compatibility between modern web standards and legacy Flash requirements.
33
33
  */
34
34
  interface KeyMapping {
35
- /**
36
- * The key value, corresponding to `KeyboardEvent.key`.
37
- * Represented as a string (e.g., " ", "Enter", "a").
38
- */
39
- key: string;
40
- /**
41
- * The physical key code, corresponding to `KeyboardEvent.code`.
42
- * Describes the physical location of the key (e.g., "Space", "Enter", "KeyA").
43
- */
44
- code: string;
45
- /**
46
- * The legacy numerical key code, corresponding to `KeyboardEvent.keyCode`.
47
- * Essential for Flash engines (AS2/AS3) running via Ruffle.
48
- * e.g., 32 for Space, 13 for Enter.
49
- */
50
- keyCode: number;
51
- }
52
- /**
53
- * Unified action definition.
54
- * Discriminated by the 'type' field, but shares a common structure for ease of use.
55
- */
56
- interface ActionMapping {
57
35
  /** 指定动作类型:'keyboard' | 'mouse' */
58
36
  type: 'keyboard' | 'mouse';
59
37
  key?: string;
@@ -64,507 +42,1239 @@ interface ActionMapping {
64
42
  /** Fixed coordinate (0-100 percentage) */
65
43
  fixedPoint?: Vec2;
66
44
  }
45
+ /**
46
+ * Standard key mapping table optimized for Ruffle/Flash environments.
47
+ * Categorized and ordered by keyCode in ascending order.
48
+ */
49
+ declare const STANDARD_KEYS: {
50
+ readonly Backspace: {
51
+ readonly type: "keyboard";
52
+ readonly key: "Backspace";
53
+ readonly code: "Backspace";
54
+ readonly keyCode: 8;
55
+ };
56
+ readonly Tab: {
57
+ readonly type: "keyboard";
58
+ readonly key: "Tab";
59
+ readonly code: "Tab";
60
+ readonly keyCode: 9;
61
+ };
62
+ readonly Enter: {
63
+ readonly type: "keyboard";
64
+ readonly key: "Enter";
65
+ readonly code: "Enter";
66
+ readonly keyCode: 13;
67
+ };
68
+ readonly ShiftLeft: {
69
+ readonly type: "keyboard";
70
+ readonly key: "Shift";
71
+ readonly code: "ShiftLeft";
72
+ readonly keyCode: 16;
73
+ };
74
+ readonly ControlLeft: {
75
+ readonly type: "keyboard";
76
+ readonly key: "Control";
77
+ readonly code: "ControlLeft";
78
+ readonly keyCode: 17;
79
+ };
80
+ readonly AltLeft: {
81
+ readonly type: "keyboard";
82
+ readonly key: "Alt";
83
+ readonly code: "AltLeft";
84
+ readonly keyCode: 18;
85
+ };
86
+ readonly Pause: {
87
+ readonly type: "keyboard";
88
+ readonly key: "Pause";
89
+ readonly code: "Pause";
90
+ readonly keyCode: 19;
91
+ };
92
+ readonly CapsLock: {
93
+ readonly type: "keyboard";
94
+ readonly key: "CapsLock";
95
+ readonly code: "CapsLock";
96
+ readonly keyCode: 20;
97
+ };
98
+ readonly Escape: {
99
+ readonly type: "keyboard";
100
+ readonly key: "Escape";
101
+ readonly code: "Escape";
102
+ readonly keyCode: 27;
103
+ };
104
+ readonly Space: {
105
+ readonly type: "keyboard";
106
+ readonly key: " ";
107
+ readonly code: "Space";
108
+ readonly keyCode: 32;
109
+ };
110
+ readonly PageUp: {
111
+ readonly type: "keyboard";
112
+ readonly key: "PageUp";
113
+ readonly code: "PageUp";
114
+ readonly keyCode: 33;
115
+ };
116
+ readonly PageDown: {
117
+ readonly type: "keyboard";
118
+ readonly key: "PageDown";
119
+ readonly code: "PageDown";
120
+ readonly keyCode: 34;
121
+ };
122
+ readonly End: {
123
+ readonly type: "keyboard";
124
+ readonly key: "End";
125
+ readonly code: "End";
126
+ readonly keyCode: 35;
127
+ };
128
+ readonly Home: {
129
+ readonly type: "keyboard";
130
+ readonly key: "Home";
131
+ readonly code: "Home";
132
+ readonly keyCode: 36;
133
+ };
134
+ readonly ArrowLeft: {
135
+ readonly type: "keyboard";
136
+ readonly key: "ArrowLeft";
137
+ readonly code: "ArrowLeft";
138
+ readonly keyCode: 37;
139
+ };
140
+ readonly ArrowUp: {
141
+ readonly type: "keyboard";
142
+ readonly key: "ArrowUp";
143
+ readonly code: "ArrowUp";
144
+ readonly keyCode: 38;
145
+ };
146
+ readonly ArrowRight: {
147
+ readonly type: "keyboard";
148
+ readonly key: "ArrowRight";
149
+ readonly code: "ArrowRight";
150
+ readonly keyCode: 39;
151
+ };
152
+ readonly ArrowDown: {
153
+ readonly type: "keyboard";
154
+ readonly key: "ArrowDown";
155
+ readonly code: "ArrowDown";
156
+ readonly keyCode: 40;
157
+ };
158
+ readonly PrintScreen: {
159
+ readonly type: "keyboard";
160
+ readonly key: "PrintScreen";
161
+ readonly code: "PrintScreen";
162
+ readonly keyCode: 44;
163
+ };
164
+ readonly Insert: {
165
+ readonly type: "keyboard";
166
+ readonly key: "Insert";
167
+ readonly code: "Insert";
168
+ readonly keyCode: 45;
169
+ };
170
+ readonly Delete: {
171
+ readonly type: "keyboard";
172
+ readonly key: "Delete";
173
+ readonly code: "Delete";
174
+ readonly keyCode: 46;
175
+ };
176
+ readonly Digit0: {
177
+ readonly type: "keyboard";
178
+ readonly key: "0";
179
+ readonly code: "Digit0";
180
+ readonly keyCode: 48;
181
+ };
182
+ readonly Digit1: {
183
+ readonly type: "keyboard";
184
+ readonly key: "1";
185
+ readonly code: "Digit1";
186
+ readonly keyCode: 49;
187
+ };
188
+ readonly Digit2: {
189
+ readonly type: "keyboard";
190
+ readonly key: "2";
191
+ readonly code: "Digit2";
192
+ readonly keyCode: 50;
193
+ };
194
+ readonly Digit3: {
195
+ readonly type: "keyboard";
196
+ readonly key: "3";
197
+ readonly code: "Digit3";
198
+ readonly keyCode: 51;
199
+ };
200
+ readonly Digit4: {
201
+ readonly type: "keyboard";
202
+ readonly key: "4";
203
+ readonly code: "Digit4";
204
+ readonly keyCode: 52;
205
+ };
206
+ readonly Digit5: {
207
+ readonly type: "keyboard";
208
+ readonly key: "5";
209
+ readonly code: "Digit5";
210
+ readonly keyCode: 53;
211
+ };
212
+ readonly Digit6: {
213
+ readonly type: "keyboard";
214
+ readonly key: "6";
215
+ readonly code: "Digit6";
216
+ readonly keyCode: 54;
217
+ };
218
+ readonly Digit7: {
219
+ readonly type: "keyboard";
220
+ readonly key: "7";
221
+ readonly code: "Digit7";
222
+ readonly keyCode: 55;
223
+ };
224
+ readonly Digit8: {
225
+ readonly type: "keyboard";
226
+ readonly key: "8";
227
+ readonly code: "Digit8";
228
+ readonly keyCode: 56;
229
+ };
230
+ readonly Digit9: {
231
+ readonly type: "keyboard";
232
+ readonly key: "9";
233
+ readonly code: "Digit9";
234
+ readonly keyCode: 57;
235
+ };
236
+ readonly KeyA: {
237
+ readonly type: "keyboard";
238
+ readonly key: "a";
239
+ readonly code: "KeyA";
240
+ readonly keyCode: 65;
241
+ };
242
+ readonly KeyB: {
243
+ readonly type: "keyboard";
244
+ readonly key: "b";
245
+ readonly code: "KeyB";
246
+ readonly keyCode: 66;
247
+ };
248
+ readonly KeyC: {
249
+ readonly type: "keyboard";
250
+ readonly key: "c";
251
+ readonly code: "KeyC";
252
+ readonly keyCode: 67;
253
+ };
254
+ readonly KeyD: {
255
+ readonly type: "keyboard";
256
+ readonly key: "d";
257
+ readonly code: "KeyD";
258
+ readonly keyCode: 68;
259
+ };
260
+ readonly KeyE: {
261
+ readonly type: "keyboard";
262
+ readonly key: "e";
263
+ readonly code: "KeyE";
264
+ readonly keyCode: 69;
265
+ };
266
+ readonly KeyF: {
267
+ readonly type: "keyboard";
268
+ readonly key: "f";
269
+ readonly code: "KeyF";
270
+ readonly keyCode: 70;
271
+ };
272
+ readonly KeyG: {
273
+ readonly type: "keyboard";
274
+ readonly key: "g";
275
+ readonly code: "KeyG";
276
+ readonly keyCode: 71;
277
+ };
278
+ readonly KeyH: {
279
+ readonly type: "keyboard";
280
+ readonly key: "h";
281
+ readonly code: "KeyH";
282
+ readonly keyCode: 72;
283
+ };
284
+ readonly KeyI: {
285
+ readonly type: "keyboard";
286
+ readonly key: "i";
287
+ readonly code: "KeyI";
288
+ readonly keyCode: 73;
289
+ };
290
+ readonly KeyJ: {
291
+ readonly type: "keyboard";
292
+ readonly key: "j";
293
+ readonly code: "KeyJ";
294
+ readonly keyCode: 74;
295
+ };
296
+ readonly KeyK: {
297
+ readonly type: "keyboard";
298
+ readonly key: "k";
299
+ readonly code: "KeyK";
300
+ readonly keyCode: 75;
301
+ };
302
+ readonly KeyL: {
303
+ readonly type: "keyboard";
304
+ readonly key: "l";
305
+ readonly code: "KeyL";
306
+ readonly keyCode: 76;
307
+ };
308
+ readonly KeyM: {
309
+ readonly type: "keyboard";
310
+ readonly key: "m";
311
+ readonly code: "KeyM";
312
+ readonly keyCode: 77;
313
+ };
314
+ readonly KeyN: {
315
+ readonly type: "keyboard";
316
+ readonly key: "n";
317
+ readonly code: "KeyN";
318
+ readonly keyCode: 78;
319
+ };
320
+ readonly KeyO: {
321
+ readonly type: "keyboard";
322
+ readonly key: "o";
323
+ readonly code: "KeyO";
324
+ readonly keyCode: 79;
325
+ };
326
+ readonly KeyP: {
327
+ readonly type: "keyboard";
328
+ readonly key: "p";
329
+ readonly code: "KeyP";
330
+ readonly keyCode: 80;
331
+ };
332
+ readonly KeyQ: {
333
+ readonly type: "keyboard";
334
+ readonly key: "q";
335
+ readonly code: "KeyQ";
336
+ readonly keyCode: 81;
337
+ };
338
+ readonly KeyR: {
339
+ readonly type: "keyboard";
340
+ readonly key: "r";
341
+ readonly code: "KeyR";
342
+ readonly keyCode: 82;
343
+ };
344
+ readonly KeyS: {
345
+ readonly type: "keyboard";
346
+ readonly key: "s";
347
+ readonly code: "KeyS";
348
+ readonly keyCode: 83;
349
+ };
350
+ readonly KeyT: {
351
+ readonly type: "keyboard";
352
+ readonly key: "t";
353
+ readonly code: "KeyT";
354
+ readonly keyCode: 84;
355
+ };
356
+ readonly KeyU: {
357
+ readonly type: "keyboard";
358
+ readonly key: "u";
359
+ readonly code: "KeyU";
360
+ readonly keyCode: 85;
361
+ };
362
+ readonly KeyV: {
363
+ readonly type: "keyboard";
364
+ readonly key: "v";
365
+ readonly code: "KeyV";
366
+ readonly keyCode: 86;
367
+ };
368
+ readonly KeyW: {
369
+ readonly type: "keyboard";
370
+ readonly key: "w";
371
+ readonly code: "KeyW";
372
+ readonly keyCode: 87;
373
+ };
374
+ readonly KeyX: {
375
+ readonly type: "keyboard";
376
+ readonly key: "x";
377
+ readonly code: "KeyX";
378
+ readonly keyCode: 88;
379
+ };
380
+ readonly KeyY: {
381
+ readonly type: "keyboard";
382
+ readonly key: "y";
383
+ readonly code: "KeyY";
384
+ readonly keyCode: 89;
385
+ };
386
+ readonly KeyZ: {
387
+ readonly type: "keyboard";
388
+ readonly key: "z";
389
+ readonly code: "KeyZ";
390
+ readonly keyCode: 90;
391
+ };
392
+ readonly MetaLeft: {
393
+ readonly type: "keyboard";
394
+ readonly key: "Meta";
395
+ readonly code: "MetaLeft";
396
+ readonly keyCode: 91;
397
+ };
398
+ readonly ContextMenu: {
399
+ readonly type: "keyboard";
400
+ readonly key: "ContextMenu";
401
+ readonly code: "ContextMenu";
402
+ readonly keyCode: 93;
403
+ };
404
+ readonly Numpad0: {
405
+ readonly type: "keyboard";
406
+ readonly key: "0";
407
+ readonly code: "Numpad0";
408
+ readonly keyCode: 96;
409
+ };
410
+ readonly Numpad1: {
411
+ readonly type: "keyboard";
412
+ readonly key: "1";
413
+ readonly code: "Numpad1";
414
+ readonly keyCode: 97;
415
+ };
416
+ readonly Numpad2: {
417
+ readonly type: "keyboard";
418
+ readonly key: "2";
419
+ readonly code: "Numpad2";
420
+ readonly keyCode: 98;
421
+ };
422
+ readonly Numpad3: {
423
+ readonly type: "keyboard";
424
+ readonly key: "3";
425
+ readonly code: "Numpad3";
426
+ readonly keyCode: 99;
427
+ };
428
+ readonly Numpad4: {
429
+ readonly type: "keyboard";
430
+ readonly key: "4";
431
+ readonly code: "Numpad4";
432
+ readonly keyCode: 100;
433
+ };
434
+ readonly Numpad5: {
435
+ readonly type: "keyboard";
436
+ readonly key: "5";
437
+ readonly code: "Numpad5";
438
+ readonly keyCode: 101;
439
+ };
440
+ readonly Numpad6: {
441
+ readonly type: "keyboard";
442
+ readonly key: "6";
443
+ readonly code: "Numpad6";
444
+ readonly keyCode: 102;
445
+ };
446
+ readonly Numpad7: {
447
+ readonly type: "keyboard";
448
+ readonly key: "7";
449
+ readonly code: "Numpad7";
450
+ readonly keyCode: 103;
451
+ };
452
+ readonly Numpad8: {
453
+ readonly type: "keyboard";
454
+ readonly key: "8";
455
+ readonly code: "Numpad8";
456
+ readonly keyCode: 104;
457
+ };
458
+ readonly Numpad9: {
459
+ readonly type: "keyboard";
460
+ readonly key: "9";
461
+ readonly code: "Numpad9";
462
+ readonly keyCode: 105;
463
+ };
464
+ readonly NumpadMultiply: {
465
+ readonly type: "keyboard";
466
+ readonly key: "*";
467
+ readonly code: "NumpadMultiply";
468
+ readonly keyCode: 106;
469
+ };
470
+ readonly NumpadAdd: {
471
+ readonly type: "keyboard";
472
+ readonly key: "+";
473
+ readonly code: "NumpadAdd";
474
+ readonly keyCode: 107;
475
+ };
476
+ readonly NumpadSubtract: {
477
+ readonly type: "keyboard";
478
+ readonly key: "-";
479
+ readonly code: "NumpadSubtract";
480
+ readonly keyCode: 109;
481
+ };
482
+ readonly NumpadDecimal: {
483
+ readonly type: "keyboard";
484
+ readonly key: ".";
485
+ readonly code: "NumpadDecimal";
486
+ readonly keyCode: 110;
487
+ };
488
+ readonly NumpadDivide: {
489
+ readonly type: "keyboard";
490
+ readonly key: "/";
491
+ readonly code: "NumpadDivide";
492
+ readonly keyCode: 111;
493
+ };
494
+ readonly F1: {
495
+ readonly type: "keyboard";
496
+ readonly key: "F1";
497
+ readonly code: "F1";
498
+ readonly keyCode: 112;
499
+ };
500
+ readonly F2: {
501
+ readonly type: "keyboard";
502
+ readonly key: "F2";
503
+ readonly code: "F2";
504
+ readonly keyCode: 113;
505
+ };
506
+ readonly F3: {
507
+ readonly type: "keyboard";
508
+ readonly key: "F3";
509
+ readonly code: "F3";
510
+ readonly keyCode: 114;
511
+ };
512
+ readonly F4: {
513
+ readonly type: "keyboard";
514
+ readonly key: "F4";
515
+ readonly code: "F4";
516
+ readonly keyCode: 115;
517
+ };
518
+ readonly F5: {
519
+ readonly type: "keyboard";
520
+ readonly key: "F5";
521
+ readonly code: "F5";
522
+ readonly keyCode: 116;
523
+ };
524
+ readonly F6: {
525
+ readonly type: "keyboard";
526
+ readonly key: "F6";
527
+ readonly code: "F6";
528
+ readonly keyCode: 117;
529
+ };
530
+ readonly F7: {
531
+ readonly type: "keyboard";
532
+ readonly key: "F7";
533
+ readonly code: "F7";
534
+ readonly keyCode: 118;
535
+ };
536
+ readonly F8: {
537
+ readonly type: "keyboard";
538
+ readonly key: "F8";
539
+ readonly code: "F8";
540
+ readonly keyCode: 119;
541
+ };
542
+ readonly F9: {
543
+ readonly type: "keyboard";
544
+ readonly key: "F9";
545
+ readonly code: "F9";
546
+ readonly keyCode: 120;
547
+ };
548
+ readonly F10: {
549
+ readonly type: "keyboard";
550
+ readonly key: "F10";
551
+ readonly code: "F10";
552
+ readonly keyCode: 121;
553
+ };
554
+ readonly F11: {
555
+ readonly type: "keyboard";
556
+ readonly key: "F11";
557
+ readonly code: "F11";
558
+ readonly keyCode: 122;
559
+ };
560
+ readonly F12: {
561
+ readonly type: "keyboard";
562
+ readonly key: "F12";
563
+ readonly code: "F12";
564
+ readonly keyCode: 123;
565
+ };
566
+ readonly NumLock: {
567
+ readonly type: "keyboard";
568
+ readonly key: "NumLock";
569
+ readonly code: "NumLock";
570
+ readonly keyCode: 144;
571
+ };
572
+ readonly ScrollLock: {
573
+ readonly type: "keyboard";
574
+ readonly key: "ScrollLock";
575
+ readonly code: "ScrollLock";
576
+ readonly keyCode: 145;
577
+ };
578
+ readonly Semicolon: {
579
+ readonly type: "keyboard";
580
+ readonly key: ";";
581
+ readonly code: "Semicolon";
582
+ readonly keyCode: 186;
583
+ };
584
+ readonly Equal: {
585
+ readonly type: "keyboard";
586
+ readonly key: "=";
587
+ readonly code: "Equal";
588
+ readonly keyCode: 187;
589
+ };
590
+ readonly Comma: {
591
+ readonly type: "keyboard";
592
+ readonly key: ",";
593
+ readonly code: "Comma";
594
+ readonly keyCode: 188;
595
+ };
596
+ readonly Minus: {
597
+ readonly type: "keyboard";
598
+ readonly key: "-";
599
+ readonly code: "Minus";
600
+ readonly keyCode: 189;
601
+ };
602
+ readonly Period: {
603
+ readonly type: "keyboard";
604
+ readonly key: ".";
605
+ readonly code: "Period";
606
+ readonly keyCode: 190;
607
+ };
608
+ readonly Slash: {
609
+ readonly type: "keyboard";
610
+ readonly key: "/";
611
+ readonly code: "Slash";
612
+ readonly keyCode: 191;
613
+ };
614
+ readonly Backquote: {
615
+ readonly type: "keyboard";
616
+ readonly key: "`";
617
+ readonly code: "Backquote";
618
+ readonly keyCode: 192;
619
+ };
620
+ readonly BracketLeft: {
621
+ readonly type: "keyboard";
622
+ readonly key: "[";
623
+ readonly code: "BracketLeft";
624
+ readonly keyCode: 219;
625
+ };
626
+ readonly Backslash: {
627
+ readonly type: "keyboard";
628
+ readonly key: "\\";
629
+ readonly code: "Backslash";
630
+ readonly keyCode: 220;
631
+ };
632
+ readonly BracketRight: {
633
+ readonly type: "keyboard";
634
+ readonly key: "]";
635
+ readonly code: "BracketRight";
636
+ readonly keyCode: 221;
637
+ };
638
+ readonly Quote: {
639
+ readonly type: "keyboard";
640
+ readonly key: "'";
641
+ readonly code: "Quote";
642
+ readonly keyCode: 222;
643
+ };
644
+ readonly Mouse: {
645
+ readonly type: "mouse";
646
+ readonly button: 0;
647
+ };
648
+ readonly MouseLeft: {
649
+ readonly type: "mouse";
650
+ readonly button: 0;
651
+ };
652
+ readonly MouseMiddle: {
653
+ readonly type: "mouse";
654
+ readonly button: 1;
655
+ };
656
+ readonly MouseRight: {
657
+ readonly type: "mouse";
658
+ readonly button: 2;
659
+ };
660
+ };
67
661
  /**
68
662
  * Standard collection of key mappings.
69
663
  * Allows developers to quickly retrieve mapping data using physical key codes as keys.
70
664
  */
71
665
  declare const KEYS: {
72
666
  readonly Backspace: {
667
+ readonly type: "keyboard";
73
668
  readonly key: "Backspace";
74
669
  readonly code: "Backspace";
75
670
  readonly keyCode: 8;
76
671
  };
77
672
  readonly Tab: {
673
+ readonly type: "keyboard";
78
674
  readonly key: "Tab";
79
675
  readonly code: "Tab";
80
676
  readonly keyCode: 9;
81
677
  };
82
678
  readonly Enter: {
679
+ readonly type: "keyboard";
83
680
  readonly key: "Enter";
84
681
  readonly code: "Enter";
85
682
  readonly keyCode: 13;
86
683
  };
87
684
  readonly ShiftLeft: {
685
+ readonly type: "keyboard";
88
686
  readonly key: "Shift";
89
687
  readonly code: "ShiftLeft";
90
688
  readonly keyCode: 16;
91
689
  };
92
690
  readonly ControlLeft: {
691
+ readonly type: "keyboard";
93
692
  readonly key: "Control";
94
693
  readonly code: "ControlLeft";
95
694
  readonly keyCode: 17;
96
695
  };
97
696
  readonly AltLeft: {
697
+ readonly type: "keyboard";
98
698
  readonly key: "Alt";
99
699
  readonly code: "AltLeft";
100
700
  readonly keyCode: 18;
101
701
  };
102
702
  readonly Pause: {
703
+ readonly type: "keyboard";
103
704
  readonly key: "Pause";
104
705
  readonly code: "Pause";
105
706
  readonly keyCode: 19;
106
707
  };
107
708
  readonly CapsLock: {
709
+ readonly type: "keyboard";
108
710
  readonly key: "CapsLock";
109
711
  readonly code: "CapsLock";
110
712
  readonly keyCode: 20;
111
713
  };
112
714
  readonly Escape: {
715
+ readonly type: "keyboard";
113
716
  readonly key: "Escape";
114
717
  readonly code: "Escape";
115
718
  readonly keyCode: 27;
116
719
  };
117
720
  readonly Space: {
721
+ readonly type: "keyboard";
118
722
  readonly key: " ";
119
723
  readonly code: "Space";
120
724
  readonly keyCode: 32;
121
725
  };
122
726
  readonly PageUp: {
727
+ readonly type: "keyboard";
123
728
  readonly key: "PageUp";
124
729
  readonly code: "PageUp";
125
730
  readonly keyCode: 33;
126
731
  };
127
732
  readonly PageDown: {
733
+ readonly type: "keyboard";
128
734
  readonly key: "PageDown";
129
735
  readonly code: "PageDown";
130
736
  readonly keyCode: 34;
131
737
  };
132
738
  readonly End: {
739
+ readonly type: "keyboard";
133
740
  readonly key: "End";
134
741
  readonly code: "End";
135
742
  readonly keyCode: 35;
136
743
  };
137
744
  readonly Home: {
745
+ readonly type: "keyboard";
138
746
  readonly key: "Home";
139
747
  readonly code: "Home";
140
748
  readonly keyCode: 36;
141
749
  };
142
750
  readonly ArrowLeft: {
751
+ readonly type: "keyboard";
143
752
  readonly key: "ArrowLeft";
144
753
  readonly code: "ArrowLeft";
145
754
  readonly keyCode: 37;
146
755
  };
147
756
  readonly ArrowUp: {
757
+ readonly type: "keyboard";
148
758
  readonly key: "ArrowUp";
149
759
  readonly code: "ArrowUp";
150
760
  readonly keyCode: 38;
151
761
  };
152
762
  readonly ArrowRight: {
763
+ readonly type: "keyboard";
153
764
  readonly key: "ArrowRight";
154
765
  readonly code: "ArrowRight";
155
766
  readonly keyCode: 39;
156
767
  };
157
768
  readonly ArrowDown: {
769
+ readonly type: "keyboard";
158
770
  readonly key: "ArrowDown";
159
771
  readonly code: "ArrowDown";
160
772
  readonly keyCode: 40;
161
773
  };
162
774
  readonly PrintScreen: {
775
+ readonly type: "keyboard";
163
776
  readonly key: "PrintScreen";
164
777
  readonly code: "PrintScreen";
165
778
  readonly keyCode: 44;
166
779
  };
167
780
  readonly Insert: {
781
+ readonly type: "keyboard";
168
782
  readonly key: "Insert";
169
783
  readonly code: "Insert";
170
784
  readonly keyCode: 45;
171
785
  };
172
786
  readonly Delete: {
787
+ readonly type: "keyboard";
173
788
  readonly key: "Delete";
174
789
  readonly code: "Delete";
175
790
  readonly keyCode: 46;
176
791
  };
177
792
  readonly Digit0: {
793
+ readonly type: "keyboard";
178
794
  readonly key: "0";
179
795
  readonly code: "Digit0";
180
796
  readonly keyCode: 48;
181
797
  };
182
798
  readonly Digit1: {
799
+ readonly type: "keyboard";
183
800
  readonly key: "1";
184
801
  readonly code: "Digit1";
185
802
  readonly keyCode: 49;
186
803
  };
187
804
  readonly Digit2: {
805
+ readonly type: "keyboard";
188
806
  readonly key: "2";
189
807
  readonly code: "Digit2";
190
808
  readonly keyCode: 50;
191
809
  };
192
810
  readonly Digit3: {
811
+ readonly type: "keyboard";
193
812
  readonly key: "3";
194
813
  readonly code: "Digit3";
195
814
  readonly keyCode: 51;
196
815
  };
197
816
  readonly Digit4: {
817
+ readonly type: "keyboard";
198
818
  readonly key: "4";
199
819
  readonly code: "Digit4";
200
820
  readonly keyCode: 52;
201
821
  };
202
822
  readonly Digit5: {
823
+ readonly type: "keyboard";
203
824
  readonly key: "5";
204
825
  readonly code: "Digit5";
205
826
  readonly keyCode: 53;
206
827
  };
207
828
  readonly Digit6: {
829
+ readonly type: "keyboard";
208
830
  readonly key: "6";
209
831
  readonly code: "Digit6";
210
832
  readonly keyCode: 54;
211
833
  };
212
834
  readonly Digit7: {
835
+ readonly type: "keyboard";
213
836
  readonly key: "7";
214
837
  readonly code: "Digit7";
215
838
  readonly keyCode: 55;
216
839
  };
217
840
  readonly Digit8: {
841
+ readonly type: "keyboard";
218
842
  readonly key: "8";
219
843
  readonly code: "Digit8";
220
844
  readonly keyCode: 56;
221
845
  };
222
846
  readonly Digit9: {
847
+ readonly type: "keyboard";
223
848
  readonly key: "9";
224
849
  readonly code: "Digit9";
225
850
  readonly keyCode: 57;
226
851
  };
227
852
  readonly KeyA: {
853
+ readonly type: "keyboard";
228
854
  readonly key: "a";
229
855
  readonly code: "KeyA";
230
856
  readonly keyCode: 65;
231
857
  };
232
858
  readonly KeyB: {
859
+ readonly type: "keyboard";
233
860
  readonly key: "b";
234
861
  readonly code: "KeyB";
235
862
  readonly keyCode: 66;
236
863
  };
237
864
  readonly KeyC: {
865
+ readonly type: "keyboard";
238
866
  readonly key: "c";
239
867
  readonly code: "KeyC";
240
868
  readonly keyCode: 67;
241
869
  };
242
870
  readonly KeyD: {
871
+ readonly type: "keyboard";
243
872
  readonly key: "d";
244
873
  readonly code: "KeyD";
245
874
  readonly keyCode: 68;
246
875
  };
247
876
  readonly KeyE: {
877
+ readonly type: "keyboard";
248
878
  readonly key: "e";
249
879
  readonly code: "KeyE";
250
880
  readonly keyCode: 69;
251
881
  };
252
882
  readonly KeyF: {
883
+ readonly type: "keyboard";
253
884
  readonly key: "f";
254
885
  readonly code: "KeyF";
255
886
  readonly keyCode: 70;
256
887
  };
257
888
  readonly KeyG: {
889
+ readonly type: "keyboard";
258
890
  readonly key: "g";
259
891
  readonly code: "KeyG";
260
892
  readonly keyCode: 71;
261
893
  };
262
894
  readonly KeyH: {
895
+ readonly type: "keyboard";
263
896
  readonly key: "h";
264
897
  readonly code: "KeyH";
265
898
  readonly keyCode: 72;
266
899
  };
267
900
  readonly KeyI: {
901
+ readonly type: "keyboard";
268
902
  readonly key: "i";
269
903
  readonly code: "KeyI";
270
904
  readonly keyCode: 73;
271
905
  };
272
906
  readonly KeyJ: {
907
+ readonly type: "keyboard";
273
908
  readonly key: "j";
274
909
  readonly code: "KeyJ";
275
910
  readonly keyCode: 74;
276
911
  };
277
912
  readonly KeyK: {
913
+ readonly type: "keyboard";
278
914
  readonly key: "k";
279
915
  readonly code: "KeyK";
280
916
  readonly keyCode: 75;
281
917
  };
282
918
  readonly KeyL: {
919
+ readonly type: "keyboard";
283
920
  readonly key: "l";
284
921
  readonly code: "KeyL";
285
922
  readonly keyCode: 76;
286
923
  };
287
924
  readonly KeyM: {
925
+ readonly type: "keyboard";
288
926
  readonly key: "m";
289
927
  readonly code: "KeyM";
290
928
  readonly keyCode: 77;
291
929
  };
292
930
  readonly KeyN: {
931
+ readonly type: "keyboard";
293
932
  readonly key: "n";
294
933
  readonly code: "KeyN";
295
934
  readonly keyCode: 78;
296
935
  };
297
936
  readonly KeyO: {
937
+ readonly type: "keyboard";
298
938
  readonly key: "o";
299
939
  readonly code: "KeyO";
300
940
  readonly keyCode: 79;
301
941
  };
302
942
  readonly KeyP: {
943
+ readonly type: "keyboard";
303
944
  readonly key: "p";
304
945
  readonly code: "KeyP";
305
946
  readonly keyCode: 80;
306
947
  };
307
948
  readonly KeyQ: {
949
+ readonly type: "keyboard";
308
950
  readonly key: "q";
309
951
  readonly code: "KeyQ";
310
952
  readonly keyCode: 81;
311
953
  };
312
954
  readonly KeyR: {
955
+ readonly type: "keyboard";
313
956
  readonly key: "r";
314
957
  readonly code: "KeyR";
315
958
  readonly keyCode: 82;
316
959
  };
317
960
  readonly KeyS: {
961
+ readonly type: "keyboard";
318
962
  readonly key: "s";
319
963
  readonly code: "KeyS";
320
964
  readonly keyCode: 83;
321
965
  };
322
966
  readonly KeyT: {
967
+ readonly type: "keyboard";
323
968
  readonly key: "t";
324
969
  readonly code: "KeyT";
325
970
  readonly keyCode: 84;
326
971
  };
327
972
  readonly KeyU: {
973
+ readonly type: "keyboard";
328
974
  readonly key: "u";
329
975
  readonly code: "KeyU";
330
976
  readonly keyCode: 85;
331
977
  };
332
978
  readonly KeyV: {
979
+ readonly type: "keyboard";
333
980
  readonly key: "v";
334
981
  readonly code: "KeyV";
335
982
  readonly keyCode: 86;
336
983
  };
337
984
  readonly KeyW: {
985
+ readonly type: "keyboard";
338
986
  readonly key: "w";
339
987
  readonly code: "KeyW";
340
988
  readonly keyCode: 87;
341
989
  };
342
990
  readonly KeyX: {
991
+ readonly type: "keyboard";
343
992
  readonly key: "x";
344
993
  readonly code: "KeyX";
345
994
  readonly keyCode: 88;
346
995
  };
347
996
  readonly KeyY: {
997
+ readonly type: "keyboard";
348
998
  readonly key: "y";
349
999
  readonly code: "KeyY";
350
1000
  readonly keyCode: 89;
351
1001
  };
352
1002
  readonly KeyZ: {
1003
+ readonly type: "keyboard";
353
1004
  readonly key: "z";
354
1005
  readonly code: "KeyZ";
355
1006
  readonly keyCode: 90;
356
1007
  };
357
1008
  readonly MetaLeft: {
1009
+ readonly type: "keyboard";
358
1010
  readonly key: "Meta";
359
1011
  readonly code: "MetaLeft";
360
1012
  readonly keyCode: 91;
361
1013
  };
362
1014
  readonly ContextMenu: {
1015
+ readonly type: "keyboard";
363
1016
  readonly key: "ContextMenu";
364
1017
  readonly code: "ContextMenu";
365
1018
  readonly keyCode: 93;
366
1019
  };
367
1020
  readonly Numpad0: {
1021
+ readonly type: "keyboard";
368
1022
  readonly key: "0";
369
1023
  readonly code: "Numpad0";
370
1024
  readonly keyCode: 96;
371
1025
  };
372
1026
  readonly Numpad1: {
1027
+ readonly type: "keyboard";
373
1028
  readonly key: "1";
374
1029
  readonly code: "Numpad1";
375
1030
  readonly keyCode: 97;
376
1031
  };
377
1032
  readonly Numpad2: {
1033
+ readonly type: "keyboard";
378
1034
  readonly key: "2";
379
1035
  readonly code: "Numpad2";
380
1036
  readonly keyCode: 98;
381
1037
  };
382
1038
  readonly Numpad3: {
1039
+ readonly type: "keyboard";
383
1040
  readonly key: "3";
384
1041
  readonly code: "Numpad3";
385
1042
  readonly keyCode: 99;
386
1043
  };
387
1044
  readonly Numpad4: {
1045
+ readonly type: "keyboard";
388
1046
  readonly key: "4";
389
1047
  readonly code: "Numpad4";
390
1048
  readonly keyCode: 100;
391
1049
  };
392
1050
  readonly Numpad5: {
1051
+ readonly type: "keyboard";
393
1052
  readonly key: "5";
394
1053
  readonly code: "Numpad5";
395
1054
  readonly keyCode: 101;
396
1055
  };
397
1056
  readonly Numpad6: {
1057
+ readonly type: "keyboard";
398
1058
  readonly key: "6";
399
1059
  readonly code: "Numpad6";
400
1060
  readonly keyCode: 102;
401
1061
  };
402
1062
  readonly Numpad7: {
1063
+ readonly type: "keyboard";
403
1064
  readonly key: "7";
404
1065
  readonly code: "Numpad7";
405
1066
  readonly keyCode: 103;
406
1067
  };
407
1068
  readonly Numpad8: {
1069
+ readonly type: "keyboard";
408
1070
  readonly key: "8";
409
1071
  readonly code: "Numpad8";
410
1072
  readonly keyCode: 104;
411
1073
  };
412
1074
  readonly Numpad9: {
1075
+ readonly type: "keyboard";
413
1076
  readonly key: "9";
414
1077
  readonly code: "Numpad9";
415
1078
  readonly keyCode: 105;
416
1079
  };
417
1080
  readonly NumpadMultiply: {
1081
+ readonly type: "keyboard";
418
1082
  readonly key: "*";
419
1083
  readonly code: "NumpadMultiply";
420
1084
  readonly keyCode: 106;
421
1085
  };
422
1086
  readonly NumpadAdd: {
1087
+ readonly type: "keyboard";
423
1088
  readonly key: "+";
424
1089
  readonly code: "NumpadAdd";
425
1090
  readonly keyCode: 107;
426
1091
  };
427
1092
  readonly NumpadSubtract: {
1093
+ readonly type: "keyboard";
428
1094
  readonly key: "-";
429
1095
  readonly code: "NumpadSubtract";
430
1096
  readonly keyCode: 109;
431
1097
  };
432
1098
  readonly NumpadDecimal: {
1099
+ readonly type: "keyboard";
433
1100
  readonly key: ".";
434
1101
  readonly code: "NumpadDecimal";
435
1102
  readonly keyCode: 110;
436
1103
  };
437
1104
  readonly NumpadDivide: {
1105
+ readonly type: "keyboard";
438
1106
  readonly key: "/";
439
1107
  readonly code: "NumpadDivide";
440
1108
  readonly keyCode: 111;
441
1109
  };
442
1110
  readonly F1: {
1111
+ readonly type: "keyboard";
443
1112
  readonly key: "F1";
444
1113
  readonly code: "F1";
445
1114
  readonly keyCode: 112;
446
1115
  };
447
1116
  readonly F2: {
1117
+ readonly type: "keyboard";
448
1118
  readonly key: "F2";
449
1119
  readonly code: "F2";
450
1120
  readonly keyCode: 113;
451
1121
  };
452
1122
  readonly F3: {
1123
+ readonly type: "keyboard";
453
1124
  readonly key: "F3";
454
1125
  readonly code: "F3";
455
1126
  readonly keyCode: 114;
456
1127
  };
457
1128
  readonly F4: {
1129
+ readonly type: "keyboard";
458
1130
  readonly key: "F4";
459
1131
  readonly code: "F4";
460
1132
  readonly keyCode: 115;
461
1133
  };
462
1134
  readonly F5: {
1135
+ readonly type: "keyboard";
463
1136
  readonly key: "F5";
464
1137
  readonly code: "F5";
465
1138
  readonly keyCode: 116;
466
1139
  };
467
1140
  readonly F6: {
1141
+ readonly type: "keyboard";
468
1142
  readonly key: "F6";
469
1143
  readonly code: "F6";
470
1144
  readonly keyCode: 117;
471
1145
  };
472
1146
  readonly F7: {
1147
+ readonly type: "keyboard";
473
1148
  readonly key: "F7";
474
1149
  readonly code: "F7";
475
1150
  readonly keyCode: 118;
476
1151
  };
477
1152
  readonly F8: {
1153
+ readonly type: "keyboard";
478
1154
  readonly key: "F8";
479
1155
  readonly code: "F8";
480
1156
  readonly keyCode: 119;
481
1157
  };
482
1158
  readonly F9: {
1159
+ readonly type: "keyboard";
483
1160
  readonly key: "F9";
484
1161
  readonly code: "F9";
485
1162
  readonly keyCode: 120;
486
1163
  };
487
1164
  readonly F10: {
1165
+ readonly type: "keyboard";
488
1166
  readonly key: "F10";
489
1167
  readonly code: "F10";
490
1168
  readonly keyCode: 121;
491
1169
  };
492
1170
  readonly F11: {
1171
+ readonly type: "keyboard";
493
1172
  readonly key: "F11";
494
1173
  readonly code: "F11";
495
1174
  readonly keyCode: 122;
496
1175
  };
497
1176
  readonly F12: {
1177
+ readonly type: "keyboard";
498
1178
  readonly key: "F12";
499
1179
  readonly code: "F12";
500
1180
  readonly keyCode: 123;
501
1181
  };
502
1182
  readonly NumLock: {
1183
+ readonly type: "keyboard";
503
1184
  readonly key: "NumLock";
504
1185
  readonly code: "NumLock";
505
1186
  readonly keyCode: 144;
506
1187
  };
507
1188
  readonly ScrollLock: {
1189
+ readonly type: "keyboard";
508
1190
  readonly key: "ScrollLock";
509
1191
  readonly code: "ScrollLock";
510
1192
  readonly keyCode: 145;
511
1193
  };
512
1194
  readonly Semicolon: {
1195
+ readonly type: "keyboard";
513
1196
  readonly key: ";";
514
1197
  readonly code: "Semicolon";
515
1198
  readonly keyCode: 186;
516
1199
  };
517
1200
  readonly Equal: {
1201
+ readonly type: "keyboard";
518
1202
  readonly key: "=";
519
1203
  readonly code: "Equal";
520
1204
  readonly keyCode: 187;
521
1205
  };
522
1206
  readonly Comma: {
1207
+ readonly type: "keyboard";
523
1208
  readonly key: ",";
524
1209
  readonly code: "Comma";
525
1210
  readonly keyCode: 188;
526
1211
  };
527
1212
  readonly Minus: {
1213
+ readonly type: "keyboard";
528
1214
  readonly key: "-";
529
1215
  readonly code: "Minus";
530
1216
  readonly keyCode: 189;
531
1217
  };
532
1218
  readonly Period: {
1219
+ readonly type: "keyboard";
533
1220
  readonly key: ".";
534
1221
  readonly code: "Period";
535
1222
  readonly keyCode: 190;
536
1223
  };
537
1224
  readonly Slash: {
1225
+ readonly type: "keyboard";
538
1226
  readonly key: "/";
539
1227
  readonly code: "Slash";
540
1228
  readonly keyCode: 191;
541
1229
  };
542
1230
  readonly Backquote: {
1231
+ readonly type: "keyboard";
543
1232
  readonly key: "`";
544
1233
  readonly code: "Backquote";
545
1234
  readonly keyCode: 192;
546
1235
  };
547
1236
  readonly BracketLeft: {
1237
+ readonly type: "keyboard";
548
1238
  readonly key: "[";
549
1239
  readonly code: "BracketLeft";
550
1240
  readonly keyCode: 219;
551
1241
  };
552
1242
  readonly Backslash: {
1243
+ readonly type: "keyboard";
553
1244
  readonly key: "\\";
554
1245
  readonly code: "Backslash";
555
1246
  readonly keyCode: 220;
556
1247
  };
557
1248
  readonly BracketRight: {
1249
+ readonly type: "keyboard";
558
1250
  readonly key: "]";
559
1251
  readonly code: "BracketRight";
560
1252
  readonly keyCode: 221;
561
1253
  };
562
1254
  readonly Quote: {
1255
+ readonly type: "keyboard";
563
1256
  readonly key: "'";
564
1257
  readonly code: "Quote";
565
1258
  readonly keyCode: 222;
566
1259
  };
1260
+ readonly Mouse: {
1261
+ readonly type: "mouse";
1262
+ readonly button: 0;
1263
+ };
1264
+ readonly MouseLeft: {
1265
+ readonly type: "mouse";
1266
+ readonly button: 0;
1267
+ };
1268
+ readonly MouseMiddle: {
1269
+ readonly type: "mouse";
1270
+ readonly button: 1;
1271
+ };
1272
+ readonly MouseRight: {
1273
+ readonly type: "mouse";
1274
+ readonly button: 2;
1275
+ };
567
1276
  };
1277
+ type ActionMapping = KeyMapping | keyof typeof STANDARD_KEYS;
568
1278
 
569
1279
  /**
570
1280
  * Defines the spatial properties of a component.
@@ -590,9 +1300,13 @@ interface LayoutBox {
590
1300
  * @example 'center' will center the component on its position.
591
1301
  */
592
1302
  anchor?: AnchorPoint;
593
- /** Rotation angle in degrees. */
594
1303
  /** Z-index for layering control. */
595
1304
  zIndex?: number;
1305
+ /**
1306
+ * CSS selector for the target element (e.g., "#game-canvas").
1307
+ * If provided, the component switches to "Sticky" mode and positions itself relative to this element.
1308
+ */
1309
+ stickySelector?: string;
596
1310
  }
597
1311
  /**
598
1312
  * Base configuration interface for all components.
@@ -600,6 +1314,7 @@ interface LayoutBox {
600
1314
  interface BaseConfig {
601
1315
  /**
602
1316
  * Config ID (CID) used in persistent storage.
1317
+ *
603
1318
  * If omitted, a random UID will be generated during parsing.
604
1319
  * If starts with '$', it points to a global static entity. (UID = CID)
605
1320
  */
@@ -612,9 +1327,10 @@ interface BaseConfig {
612
1327
  layout: LayoutBox;
613
1328
  /**
614
1329
  * Custom CSS class names or style tags.
615
- * For visual decoration only; must not include layout attributes such as top/left/width/height.
1330
+ *
1331
+ * For visual decoration only; must not include layout attributes such as top/left/width/height while the same properties are set in `layout: LayoutBox`.
616
1332
  */
617
- cssClasses?: string | string[];
1333
+ cssClass?: string;
618
1334
  }
619
1335
  /**
620
1336
  * Configuration for a virtual keyboard/mouse button.
@@ -724,9 +1440,9 @@ interface FlatConfigItem {
724
1440
  config?: Record<string, any>;
725
1441
  }
726
1442
  /**
727
- * The root structure of a Gamepad configuration file.
1443
+ * The root structure of a OmniPad configuration file.
728
1444
  */
729
- interface GamepadProfile {
1445
+ interface OmniPadProfile {
730
1446
  /** Metadata about the profile creator and version. */
731
1447
  meta: {
732
1448
  name: string;
@@ -757,155 +1473,6 @@ interface ConfigTreeNode {
757
1473
  children?: ConfigTreeNode[];
758
1474
  }
759
1475
 
760
- /**
761
- * Trait: Provides identity with a unique ID and specific entity type.
762
- */
763
- interface IIdentifiable {
764
- readonly uid: string;
765
- readonly type: EntityType;
766
- }
767
- /**
768
- * Trait: Provides lifecycle management hooks.
769
- */
770
- interface ILifecycle {
771
- /**
772
- * Performs cleanup, unregisters the entity, and releases resources.
773
- */
774
- destroy(): void;
775
- }
776
- /**
777
- * The core contract for any object that can be managed by the Registry.
778
- * Only objects implementing this interface are eligible for registration.
779
- */
780
- interface ICoreEntity extends IIdentifiable, ILifecycle {
781
- }
782
- /**
783
- * Trait: Enables spatial awareness for DOM/UI-related components.
784
- */
785
- interface ISpatial {
786
- readonly rect: AbstractRect | null;
787
- /**
788
- * Dynamically obtain dimensions and position to ensure the most precise real-time screen coordinates are obtained during each interaction.
789
- */
790
- bindRectProvider(provider: () => AbstractRect, onMarkDirty?: () => void): void;
791
- /**
792
- * Trigger a cache invalidation.
793
- */
794
- markRectDirty(): void;
795
- }
796
- /**
797
- * Trait: Provides configuration management.
798
- */
799
- interface IConfigurable<TConfig> {
800
- /**
801
- * Retrieves a snapshot of the current configuration.
802
- */
803
- getConfig(): TConfig;
804
- /**
805
- * Subscribes to config changes.
806
- * @param cb - Callback function triggered on config updates.
807
- * @returns An unsubscribe function.
808
- */
809
- subscribeConfig(cb: (config: TConfig) => void): () => void;
810
- /**
811
- * Updates the internal config and notifies all subscribers.
812
- * @param config - Partial configuration object to merge.
813
- */
814
- updateConfig(config: Partial<TConfig>): void;
815
- }
816
- /**
817
- * Trait: Provides state management.
818
- */
819
- interface IStateful<TState> {
820
- /**
821
- * Retrieves the current state snapshot.
822
- */
823
- getState(): TState;
824
- /**
825
- * Subscribes to state changes.
826
- * @param cb - Callback function triggered on state updates.
827
- * @returns An unsubscribe function.
828
- */
829
- subscribeState(cb: (state: TState) => void): () => void;
830
- /**
831
- * Updates the internal state and notifies all subscribers.
832
- * @param state - Partial object containing updated state values.
833
- */
834
- setState(state: Partial<TState>): void;
835
- }
836
- /**
837
- * Trait: Allows resetting the entity to its idle/safe state.
838
- */
839
- interface IResettable {
840
- /**
841
- * Forcefully clears active states and cuts off outgoing signals.
842
- */
843
- reset(): void;
844
- }
845
- /**
846
- * Trait: Handles raw pointer input (Touch/Mouse).
847
- */
848
- interface IPointerHandler {
849
- readonly activePointerId: number | null;
850
- onPointerDown(e: AbstractPointerEvent): void;
851
- onPointerMove(e: AbstractPointerEvent): void;
852
- onPointerUp(e: AbstractPointerEvent): void;
853
- onPointerCancel(e: AbstractPointerEvent): void;
854
- }
855
- /**
856
- * Trait: Receives and processes input signals (e.g., TargetZone).
857
- */
858
- interface ISignalReceiver {
859
- /**
860
- * Handles incoming signals from widgets.
861
- * @param signal - The signal data containing action type and payload.
862
- */
863
- handleSignal(signal: InputActionSignal): void;
864
- }
865
- /**
866
- * Capability for an entity to receive and store external functional dependencies.
867
- *
868
- * This enables Runtime Dependency Injection (DI), allowing core logic to invoke
869
- * host-specific methods (such as DOM event dispatchers or custom triggers)
870
- * without being tightly coupled to the environment.
871
- */
872
- interface IDependencyBindable {
873
- /**
874
- * Binds a functional delegate by a specific identifier key.
875
- *
876
- * @param key - The unique lookup identifier for the dependency (e.g., 'domDispatcher').
877
- * @param delegate - The function implementation provided by the adapter layer.
878
- */
879
- bindDelegate(key: string, delegate: AnyFunction): void;
880
- }
881
- /**
882
- * Contract for widgets that support programmatic control.
883
- *
884
- * This interface allows external systems—such as a Physical Gamepad Manager or
885
- * automation scripts—to directly drive the state and behavior of a widget,
886
- * bypassing native DOM pointer events.
887
- */
888
- interface IProgrammatic {
889
- /**
890
- * Manually triggers the 'down' (pressed) state of the widget.
891
- * Primarily used for Button-type components to simulate a physical press.
892
- */
893
- triggerDown?(): void;
894
- /**
895
- * Manually triggers the 'up' (released) state of the widget.
896
- * Primarily used for Button-type components to simulate a physical release.
897
- */
898
- triggerUp?(): void;
899
- /**
900
- * Manually updates the directional input vector of the widget.
901
- * Primarily used for Joystick or D-Pad components.
902
- *
903
- * @param x - The horizontal component, normalized between -1.0 and 1.0.
904
- * @param y - The vertical component, normalized between -1.0 and 1.0.
905
- */
906
- triggerVector?(x: number, y: number): void;
907
- }
908
-
909
1476
  /**
910
1477
  * =================================================================
911
1478
  * 1. Constants Definition
@@ -957,16 +1524,20 @@ declare const ACTION_TYPES: {
957
1524
  * 2. Type Definitions
958
1525
  * =================================================================
959
1526
  */
960
- /** * Represents an abstract bounding box, typically used as a
1527
+ /**
1528
+ * Represents an abstract bounding box, typically used as a
961
1529
  * lightweight alternative to the DOMRect interface.
962
1530
  */
963
1531
  interface AbstractRect {
964
1532
  left: number;
1533
+ right: number;
965
1534
  top: number;
1535
+ bottom: number;
966
1536
  width: number;
967
1537
  height: number;
968
1538
  }
969
- /** * Represents abstract pointer data, providing a platform-agnostic
1539
+ /**
1540
+ * Represents abstract pointer data, providing a platform-agnostic
970
1541
  * alternative to the native PointerEvent.
971
1542
  */
972
1543
  interface AbstractPointerEvent {
@@ -1005,7 +1576,7 @@ type InputActionType = BuiltInActionType | (string & {});
1005
1576
  * Supported CSS units for layout calculation.
1006
1577
  * Using a constant array for runtime validation.
1007
1578
  */
1008
- declare const VALID_UNITS: readonly ["px", "%", "vh", "vw", "rem", "em"];
1579
+ declare const VALID_UNITS: readonly ["px", "%", "vh", "vw", "vmin", "vmax", "rem", "em"];
1009
1580
  /**
1010
1581
  * Derived type for type safety in TS
1011
1582
  */
@@ -1073,4 +1644,4 @@ declare const CONTEXT: {
1073
1644
  */
1074
1645
  type AnyFunction = (...args: any[]) => void;
1075
1646
 
1076
- export { type AbstractRect as A, type ButtonConfig as B, CMP_TYPES as C, type DPadConfig as D, type EntityType as E, type FlatConfigItem as F, type GamepadMappingConfig as G, type ILifecycle as H, type ICoreEntity as I, type JoystickConfig as J, type InputActionType as K, KEYS as L, type KeyMapping as M, type LayoutBox as N, type StandardButton as O, type ParsedLength as P, VALID_UNITS as Q, type WidgetType as R, type StageId as S, type TargetZoneConfig as T, type ZoneType as U, type Vec2 as V, type WidgetId as W, type ZoneId as Z, type InputActionSignal as a, type ISpatial as b, type IResettable as c, type IConfigurable as d, type IStateful as e, type IPointerHandler as f, type IProgrammatic as g, type AbstractPointerEvent as h, type InputZoneConfig as i, type IDependencyBindable as j, type AnyFunction as k, type BaseConfig as l, type ISignalReceiver as m, type TrackpadConfig as n, ACTION_TYPES as o, type ActionMapping as p, type AnchorPoint as q, type AnyConfig as r, type AnyEntityType as s, type BuiltInActionType as t, CONTEXT as u, type ConfigTreeNode as v, type CssUnit as w, type FlexibleLength as x, type GamepadProfile as y, type IIdentifiable as z };
1647
+ export { type AnyFunction as A, type BaseConfig as B, type ConfigTreeNode as C, type DPadConfig as D, type EntityType as E, type FlatConfigItem as F, type GamepadMappingConfig as G, type InputActionSignal as I, type JoystickConfig as J, KEYS as K, type LayoutBox as L, type OmniPadProfile as O, type ParsedLength as P, type StageId as S, type TargetZoneConfig as T, type Vec2 as V, type WidgetId as W, type ZoneId as Z, type AbstractRect as a, type ButtonConfig as b, type AbstractPointerEvent as c, type InputZoneConfig as d, type TrackpadConfig as e, ACTION_TYPES as f, type ActionMapping as g, type AnchorPoint as h, type AnyConfig as i, type AnyEntityType as j, type BuiltInActionType as k, CMP_TYPES as l, CONTEXT as m, type CssUnit as n, type FlexibleLength as o, type InputActionType as p, type KeyMapping as q, type StandardButton as r, VALID_UNITS as s, type WidgetType as t, type ZoneType as u };