pixijs-input-devices 0.1.0 → 0.1.2
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/index.cjs +355 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +461 -0
- package/dist/index.mjs +355 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import * as PIXI from 'pixi.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* PixiJs Mixin:
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
declare module 'pixi.js' {
|
|
9
|
+
|
|
10
|
+
export interface Container {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @returns true when navigationMode is "target", or
|
|
14
|
+
* navigationMode is "auto" and the container handles
|
|
15
|
+
* either "pointerdown" or "mousedown" events.
|
|
16
|
+
*/
|
|
17
|
+
readonly isNavigatable: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* When selecting a default navigation focus target, the
|
|
21
|
+
* target with the largest priority is chosen.
|
|
22
|
+
* @default 0
|
|
23
|
+
*/
|
|
24
|
+
readonly navigationPriority: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether this container is explicitly navigatable or not.
|
|
28
|
+
*/
|
|
29
|
+
navigationMode?: "auto" | "target" | "disabled" | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {};
|
|
35
|
+
import { Container } from 'pixi.js';
|
|
36
|
+
|
|
37
|
+
declare class GamepadJoystick {
|
|
38
|
+
private _owner;
|
|
39
|
+
private ix;
|
|
40
|
+
private iy;
|
|
41
|
+
constructor(_owner: GamepadDeviceSource, ix: number, iy: number);
|
|
42
|
+
/** A scalar -1.0 to 1.0 representing the X-axis position on the stick */
|
|
43
|
+
get x(): number;
|
|
44
|
+
/** A scalar -1.0 to 1.0 representing the Y-axis position on the stick */
|
|
45
|
+
get y(): number;
|
|
46
|
+
}
|
|
47
|
+
export declare abstract class CustomDevice {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly type = "custom";
|
|
50
|
+
assignee?: any;
|
|
51
|
+
lastUpdated: number;
|
|
52
|
+
constructor(id: string);
|
|
53
|
+
update(now: number): void;
|
|
54
|
+
clear(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A gamepad (game controller).
|
|
58
|
+
*
|
|
59
|
+
* Provides bindings and accessors for standard controller/gamepad layout:
|
|
60
|
+
* - 2 Joysticks: `leftJoystick`, `rightJoystick`
|
|
61
|
+
* - 16 Buttons: `button[...]`
|
|
62
|
+
*
|
|
63
|
+
* Direct Gamepad API access available too, via `source`.
|
|
64
|
+
*/
|
|
65
|
+
export declare class GamepadDevice {
|
|
66
|
+
source: Gamepad;
|
|
67
|
+
static defaultOptions: {
|
|
68
|
+
binds: {
|
|
69
|
+
0: "trigger";
|
|
70
|
+
1: "navigateBack";
|
|
71
|
+
8: "navigateBack";
|
|
72
|
+
13: "navigateDown";
|
|
73
|
+
14: "navigateLeft";
|
|
74
|
+
15: "navigateRight";
|
|
75
|
+
12: "navigateUp";
|
|
76
|
+
};
|
|
77
|
+
joystickDeadzone: number;
|
|
78
|
+
intent: {
|
|
79
|
+
joystickCommitSensitivity: number;
|
|
80
|
+
firstCooldownMs: number;
|
|
81
|
+
defaultCooldownMs: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Globally unique identifier for this gamepad slot.
|
|
86
|
+
* @example "gamepad0"
|
|
87
|
+
*/
|
|
88
|
+
readonly id: string;
|
|
89
|
+
readonly type = "gamepad";
|
|
90
|
+
/**
|
|
91
|
+
* Platform of this gamepad, useful for configuring standard
|
|
92
|
+
* button layouts or displaying branded icons.
|
|
93
|
+
* @example "playstation"
|
|
94
|
+
*/
|
|
95
|
+
platform: GamepadPlatform;
|
|
96
|
+
lastUpdated: number;
|
|
97
|
+
/** Configurable metadata. */
|
|
98
|
+
assignee?: any;
|
|
99
|
+
options: {
|
|
100
|
+
binds: {
|
|
101
|
+
0: "trigger";
|
|
102
|
+
1: "navigateBack";
|
|
103
|
+
8: "navigateBack";
|
|
104
|
+
13: "navigateDown";
|
|
105
|
+
14: "navigateLeft";
|
|
106
|
+
15: "navigateRight";
|
|
107
|
+
12: "navigateUp";
|
|
108
|
+
};
|
|
109
|
+
joystickDeadzone: number;
|
|
110
|
+
intent: {
|
|
111
|
+
joystickCommitSensitivity: number;
|
|
112
|
+
firstCooldownMs: number;
|
|
113
|
+
defaultCooldownMs: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
private _btnPrevState;
|
|
117
|
+
private _axisIntents;
|
|
118
|
+
private readonly _throttleIdLeftStickX;
|
|
119
|
+
private readonly _throttleIdLeftStickY;
|
|
120
|
+
/** Left Joystick */
|
|
121
|
+
readonly leftJoystick: GamepadJoystick;
|
|
122
|
+
/** Right Joystick */
|
|
123
|
+
readonly rightJoystick: GamepadJoystick;
|
|
124
|
+
/** A scalar 0.0 to 1.0 representing the trigger pull */
|
|
125
|
+
get leftTrigger(): number;
|
|
126
|
+
/** A scalar 0.0 to 1.0 representing the trigger pull */
|
|
127
|
+
get rightTrigger(): number;
|
|
128
|
+
/** A scalar 0.0 to 1.0 representing the trigger pull */
|
|
129
|
+
get leftShoulder(): number;
|
|
130
|
+
/** A scalar 0.0 to 1.0 representing the trigger pull */
|
|
131
|
+
get rightShoulder(): number;
|
|
132
|
+
/** Gamepad button accessors */
|
|
133
|
+
get button(): GamepadButtons;
|
|
134
|
+
/** Check whether a button is pressed */
|
|
135
|
+
pressing(button: Button): boolean;
|
|
136
|
+
/** Check whether all buttons in a group are pressed */
|
|
137
|
+
pressingAll(group: Button[]): boolean;
|
|
138
|
+
/** Check whether at least one button in a group is pressed */
|
|
139
|
+
pressingAny(group: Button[]): boolean;
|
|
140
|
+
update(source: Gamepad, now: number): void;
|
|
141
|
+
clear(): void;
|
|
142
|
+
constructor(source: Gamepad);
|
|
143
|
+
private updatePresses;
|
|
144
|
+
}
|
|
145
|
+
export declare class InputDeviceManager {
|
|
146
|
+
static readonly shared: InputDeviceManager;
|
|
147
|
+
static readonly gamepadsApiSupported: boolean;
|
|
148
|
+
private hasFocus;
|
|
149
|
+
/** Global keyboard. These inputs are always up to date.. */
|
|
150
|
+
readonly keyboard: KeyboardDevice;
|
|
151
|
+
/** Connected gamepads. Keep in mind these inputs are only up-to-date from the last update(). */
|
|
152
|
+
get gamepads(): readonly GamepadDevice[];
|
|
153
|
+
/** Connected devices. Keep in mind these inputs may only be up-to-date from the last update(). */
|
|
154
|
+
get devices(): readonly InputDevice[];
|
|
155
|
+
options: {
|
|
156
|
+
clearInputInBackground: boolean;
|
|
157
|
+
};
|
|
158
|
+
private _devices;
|
|
159
|
+
private _gamepadDevices;
|
|
160
|
+
private _gamepadDeviceMap;
|
|
161
|
+
private constructor();
|
|
162
|
+
/**
|
|
163
|
+
* Performs a poll of latest input from all devices
|
|
164
|
+
*/
|
|
165
|
+
update(): ReadonlyArray<InputDevice>;
|
|
166
|
+
/** Add a custom device. */
|
|
167
|
+
add(device: CustomDevice): void;
|
|
168
|
+
/** Remove a custom device. */
|
|
169
|
+
remove(device: InputDevice): void;
|
|
170
|
+
/**
|
|
171
|
+
* @returns updates connected gamepads, performing a poll of latest input
|
|
172
|
+
*/
|
|
173
|
+
pollGamepads(now: number): ReadonlyArray<GamepadDevice>;
|
|
174
|
+
private removeGamepad;
|
|
175
|
+
}
|
|
176
|
+
export declare class KeyboardDevice {
|
|
177
|
+
readonly id: "keyboard";
|
|
178
|
+
readonly type: "keyboard";
|
|
179
|
+
layout: KeyboardLayout;
|
|
180
|
+
assignee?: any;
|
|
181
|
+
lastUpdated: number;
|
|
182
|
+
static defaultOptions: {
|
|
183
|
+
binds: {
|
|
184
|
+
Enter: "trigger";
|
|
185
|
+
Escape: "navigateBack";
|
|
186
|
+
ArrowDown: "navigateDown";
|
|
187
|
+
ArrowLeft: "navigateLeft";
|
|
188
|
+
ArrowRight: "navigateRight";
|
|
189
|
+
ArrowUp: "navigateUp";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
options: {
|
|
193
|
+
binds: {
|
|
194
|
+
0: "trigger";
|
|
195
|
+
1: "navigateBack";
|
|
196
|
+
8: "navigateBack";
|
|
197
|
+
13: "navigateDown";
|
|
198
|
+
14: "navigateLeft";
|
|
199
|
+
15: "navigateRight";
|
|
200
|
+
12: "navigateUp";
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
configureEventListeners(): void;
|
|
204
|
+
/** Accessors for keys */
|
|
205
|
+
key: Record<KeyCode, boolean>;
|
|
206
|
+
/** Check whether a key is pressed */
|
|
207
|
+
pressing(key: KeyCode): boolean;
|
|
208
|
+
/** Check whether all buttons in a group are pressed */
|
|
209
|
+
pressingAll(group: KeyCode[]): boolean;
|
|
210
|
+
/** Check whether at least one button in a group is pressed */
|
|
211
|
+
pressingAny(group: KeyCode[]): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Get the label for the given key code in the current keyboard layout.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* // when AZERTY
|
|
217
|
+
* keyboard.localeLabel( "KeyQ" ) // "A"
|
|
218
|
+
*
|
|
219
|
+
* // when JCUKEN
|
|
220
|
+
* keyboard.localeLabel( "KeyQ" ) // "Й"
|
|
221
|
+
*/
|
|
222
|
+
keyLabel(key: KeyCode, layout?: KeyboardLayout): string;
|
|
223
|
+
/**
|
|
224
|
+
* Clear all keyboard keys.
|
|
225
|
+
*/
|
|
226
|
+
clear(): void;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Responsible for global navigation interactions.
|
|
230
|
+
*
|
|
231
|
+
* Set stageRoot to enable the global responder behaviors.
|
|
232
|
+
*/
|
|
233
|
+
export declare class Navigation {
|
|
234
|
+
static shared: Navigation;
|
|
235
|
+
/**
|
|
236
|
+
* Set the stage root to automatically handle global
|
|
237
|
+
* navigation intents.
|
|
238
|
+
*/
|
|
239
|
+
stageRoot?: Container;
|
|
240
|
+
private _focused?;
|
|
241
|
+
private _responderStack;
|
|
242
|
+
private constructor();
|
|
243
|
+
/**
|
|
244
|
+
* Active global interaction target
|
|
245
|
+
*/
|
|
246
|
+
get firstResponder(): NavigationResponder | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Stack of global interaction targets
|
|
249
|
+
*/
|
|
250
|
+
get responders(): readonly NavigationResponder[];
|
|
251
|
+
/**
|
|
252
|
+
* Emit interaction intent to the first responder,
|
|
253
|
+
* or the global responder if none.
|
|
254
|
+
*/
|
|
255
|
+
emit(intent: NavigationIntent, device: InputDevice): void;
|
|
256
|
+
/**
|
|
257
|
+
* Remove the top-most global interaction target
|
|
258
|
+
*/
|
|
259
|
+
popResponder(): NavigationResponder | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Set the new top-most global interaction target.
|
|
262
|
+
*/
|
|
263
|
+
pushResponder(responder: NavigationResponder): void;
|
|
264
|
+
private _propogateIntent;
|
|
265
|
+
private _handleGlobalIntent;
|
|
266
|
+
}
|
|
267
|
+
export declare const Button: {
|
|
268
|
+
/** A Button (Xbox / Nintendo: "A", PlayStation: "Cross") */
|
|
269
|
+
readonly A: 0;
|
|
270
|
+
/** B Button (Xbox: "B", PlayStation: "Circle", Nintendo: "X") */
|
|
271
|
+
readonly B: 1;
|
|
272
|
+
/** X Button (Xbox: "X", PlayStation: "Square", Nintendo: "B") */
|
|
273
|
+
readonly X: 2;
|
|
274
|
+
/** Y Button (Xbox / Nintendo: "Y", PlayStation: "Triangle") */
|
|
275
|
+
readonly Y: 3;
|
|
276
|
+
/** Left Shoulder Button (Xbox: "LB", PlayStation: "L1", Nintendo: "L") */
|
|
277
|
+
readonly LeftShoulder: 4;
|
|
278
|
+
/** Right Shoulder Button (Xbox: "RB", PlayStation: "R1", Nintendo: "R") */
|
|
279
|
+
readonly RightShoulder: 5;
|
|
280
|
+
/** Left Trigger (Xbox: "LT", PlayStation: "L2", Nintendo: "ZL") */
|
|
281
|
+
readonly LeftTrigger: 6;
|
|
282
|
+
/** Right Trigger (Xbox: "RT", PlayStation: "R2", Nintendo: "ZR") */
|
|
283
|
+
readonly RightTrigger: 7;
|
|
284
|
+
/** Bak Button (Xbox: "Share", PlayStation: "Options", Nintendo: "-") */
|
|
285
|
+
readonly Back: 8;
|
|
286
|
+
/** Start Button (Xbox: "Start", PlayStation: "Select", Nintendo: "+") */
|
|
287
|
+
readonly Start: 9;
|
|
288
|
+
/** Left Stick Press (Xbox / PlayStation: "LS", Nintendo: "L3") */
|
|
289
|
+
readonly LeftStick: 10;
|
|
290
|
+
/** Right Stick Press (Xbox / PlayStation: "RS", Nintendo: "R3") */
|
|
291
|
+
readonly RightStick: 11;
|
|
292
|
+
/** D-Pad Up */
|
|
293
|
+
readonly DPadUp: 12;
|
|
294
|
+
/** D-Pad Down */
|
|
295
|
+
readonly DPadDown: 13;
|
|
296
|
+
/** D-Pad Left */
|
|
297
|
+
readonly DPadLeft: 14;
|
|
298
|
+
/** D-Pad Right */
|
|
299
|
+
readonly DPadRight: 15;
|
|
300
|
+
};
|
|
301
|
+
export declare const KeyCode: {
|
|
302
|
+
readonly ArrowLeft: "ArrowLeft";
|
|
303
|
+
readonly ArrowRight: "ArrowRight";
|
|
304
|
+
readonly ArrowUp: "ArrowUp";
|
|
305
|
+
readonly ArrowDown: "ArrowDown";
|
|
306
|
+
readonly KeyA: "KeyA";
|
|
307
|
+
readonly KeyB: "KeyB";
|
|
308
|
+
readonly KeyC: "KeyC";
|
|
309
|
+
readonly KeyD: "KeyD";
|
|
310
|
+
readonly KeyE: "KeyE";
|
|
311
|
+
readonly KeyF: "KeyF";
|
|
312
|
+
readonly KeyG: "KeyG";
|
|
313
|
+
readonly KeyH: "KeyH";
|
|
314
|
+
readonly KeyI: "KeyI";
|
|
315
|
+
readonly KeyJ: "KeyJ";
|
|
316
|
+
readonly KeyK: "KeyK";
|
|
317
|
+
readonly KeyL: "KeyL";
|
|
318
|
+
readonly KeyM: "KeyM";
|
|
319
|
+
readonly KeyN: "KeyN";
|
|
320
|
+
readonly KeyO: "KeyO";
|
|
321
|
+
readonly KeyP: "KeyP";
|
|
322
|
+
readonly KeyQ: "KeyQ";
|
|
323
|
+
readonly KeyR: "KeyR";
|
|
324
|
+
readonly KeyS: "KeyS";
|
|
325
|
+
readonly KeyT: "KeyT";
|
|
326
|
+
readonly KeyU: "KeyU";
|
|
327
|
+
readonly KeyV: "KeyV";
|
|
328
|
+
readonly KeyW: "KeyW";
|
|
329
|
+
readonly KeyX: "KeyX";
|
|
330
|
+
readonly KeyY: "KeyY";
|
|
331
|
+
readonly KeyZ: "KeyZ";
|
|
332
|
+
readonly Digit0: "Digit0";
|
|
333
|
+
readonly Digit1: "Digit1";
|
|
334
|
+
readonly Digit2: "Digit2";
|
|
335
|
+
readonly Digit3: "Digit3";
|
|
336
|
+
readonly Digit4: "Digit4";
|
|
337
|
+
readonly Digit5: "Digit5";
|
|
338
|
+
readonly Digit6: "Digit6";
|
|
339
|
+
readonly Digit7: "Digit7";
|
|
340
|
+
readonly Digit8: "Digit8";
|
|
341
|
+
readonly Digit9: "Digit9";
|
|
342
|
+
readonly Backquote: "Backquote";
|
|
343
|
+
readonly Backslash: "Backslash";
|
|
344
|
+
readonly Backspace: "Backspace";
|
|
345
|
+
readonly BracketLeft: "BracketLeft";
|
|
346
|
+
readonly BracketRight: "BracketRight";
|
|
347
|
+
readonly Comma: "Comma";
|
|
348
|
+
readonly Delete: "Delete";
|
|
349
|
+
readonly End: "End";
|
|
350
|
+
readonly Enter: "Enter";
|
|
351
|
+
readonly Equal: "Equal";
|
|
352
|
+
readonly Escape: "Escape";
|
|
353
|
+
readonly Home: "Home";
|
|
354
|
+
readonly Minus: "Minus";
|
|
355
|
+
readonly Period: "Period";
|
|
356
|
+
readonly Quote: "Quote";
|
|
357
|
+
readonly Semicolon: "Semicolon";
|
|
358
|
+
readonly Slash: "Slash";
|
|
359
|
+
readonly Space: "Space";
|
|
360
|
+
readonly ShiftRight: "ShiftRight";
|
|
361
|
+
readonly AltRight: "AltRight";
|
|
362
|
+
readonly ControlRight: "ControlRight";
|
|
363
|
+
readonly MetaRight: "MetaRight";
|
|
364
|
+
readonly ShiftLeft: "ShiftLeft";
|
|
365
|
+
readonly AltLeft: "AltLeft";
|
|
366
|
+
readonly ControlLeft: "ControlLeft";
|
|
367
|
+
readonly MetaLeft: "MetaLeft";
|
|
368
|
+
readonly Numpad0: "Numpad0";
|
|
369
|
+
readonly Numpad1: "Numpad1";
|
|
370
|
+
readonly Numpad2: "Numpad2";
|
|
371
|
+
readonly Numpad3: "Numpad3";
|
|
372
|
+
readonly Numpad4: "Numpad4";
|
|
373
|
+
readonly Numpad5: "Numpad5";
|
|
374
|
+
readonly Numpad6: "Numpad6";
|
|
375
|
+
readonly Numpad7: "Numpad7";
|
|
376
|
+
readonly Numpad8: "Numpad8";
|
|
377
|
+
readonly Numpad9: "Numpad9";
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* @returns all navigatable containers in some container
|
|
381
|
+
*/
|
|
382
|
+
export declare function getAllNavigatables(root: Container): NavigatableContainer[];
|
|
383
|
+
/**
|
|
384
|
+
* @returns the first navigatable container in the given direction
|
|
385
|
+
*/
|
|
386
|
+
export declare function getFirstNavigatable(root: Container, currentFocus?: Container, nearestDirection?: NavigationDirection, { minimumDistance, }?: {
|
|
387
|
+
minimumDistance?: number;
|
|
388
|
+
}): NavigatableContainer | undefined;
|
|
389
|
+
/**
|
|
390
|
+
* @returns the first navigatable container in the given direction
|
|
391
|
+
*/
|
|
392
|
+
export declare function getFirstNavigatableInDirection(navigatables: NavigatableContainer[], currentFocus?: Container, nearestDirection?: NavigationDirection, { minimumDistance, }?: {
|
|
393
|
+
minimumDistance?: number;
|
|
394
|
+
}): NavigatableContainer | undefined;
|
|
395
|
+
/**
|
|
396
|
+
* A target that responds to navigation on the stack.
|
|
397
|
+
*/
|
|
398
|
+
export interface NavigationResponder {
|
|
399
|
+
/**
|
|
400
|
+
* Called when received a navigation intent. The target should handle, and
|
|
401
|
+
* respond with a boolean indicating whether or not the intent was handled.
|
|
402
|
+
*
|
|
403
|
+
* Unhandled interaction intents will be bubbled up to the next target. You
|
|
404
|
+
* might return `true` here to prevent any intent from being propagated.
|
|
405
|
+
*/
|
|
406
|
+
handledNavigationIntent?(intent: NavigationIntent, device: InputDevice): boolean;
|
|
407
|
+
/**
|
|
408
|
+
* This method is triggered when the target became the first responder.
|
|
409
|
+
*
|
|
410
|
+
* Either when pushed, or when another target stopped being the first
|
|
411
|
+
* responder.
|
|
412
|
+
*/
|
|
413
|
+
becameFirstResponder?(): void;
|
|
414
|
+
/**
|
|
415
|
+
* This method is triggered when the target stopped being first responder.
|
|
416
|
+
*
|
|
417
|
+
* Either popped, or another target was pushed on top of the stack.
|
|
418
|
+
*/
|
|
419
|
+
resignedAsFirstResponder?(): void;
|
|
420
|
+
}
|
|
421
|
+
export type Button = (typeof Button)[keyof typeof Button];
|
|
422
|
+
/** Array with strongly-typed indices (0-15) */
|
|
423
|
+
export type GamepadButtons = {
|
|
424
|
+
[Button.A]: GamepadButton;
|
|
425
|
+
[Button.B]: GamepadButton;
|
|
426
|
+
[Button.X]: GamepadButton;
|
|
427
|
+
[Button.Y]: GamepadButton;
|
|
428
|
+
[Button.LeftShoulder]: GamepadButton;
|
|
429
|
+
[Button.RightShoulder]: GamepadButton;
|
|
430
|
+
[Button.LeftTrigger]: GamepadButton;
|
|
431
|
+
[Button.RightTrigger]: GamepadButton;
|
|
432
|
+
[Button.Back]: GamepadButton;
|
|
433
|
+
[Button.Start]: GamepadButton;
|
|
434
|
+
[Button.LeftStick]: GamepadButton;
|
|
435
|
+
[Button.RightStick]: GamepadButton;
|
|
436
|
+
[Button.DPadUp]: GamepadButton;
|
|
437
|
+
[Button.DPadDown]: GamepadButton;
|
|
438
|
+
[Button.DPadLeft]: GamepadButton;
|
|
439
|
+
[Button.DPadRight]: GamepadButton;
|
|
440
|
+
};
|
|
441
|
+
export type GamepadDeviceSource = {
|
|
442
|
+
source: Gamepad;
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* Common gamepad platforms, which may indicate button layout.
|
|
446
|
+
*
|
|
447
|
+
* Note: Non-comprehensive list, covers the most brands only.
|
|
448
|
+
*/
|
|
449
|
+
export type GamepadPlatform = "logitech" | "nintendo" | "playstation" | "steam" | "xbox" | "other";
|
|
450
|
+
export type InputDevice = GamepadDevice | KeyboardDevice | CustomDevice;
|
|
451
|
+
export type KeyCode = (typeof KeyCode)[keyof typeof KeyCode];
|
|
452
|
+
/**
|
|
453
|
+
* Supported keyboard layouts.
|
|
454
|
+
*/
|
|
455
|
+
export type KeyboardLayout = "QWERTY" | "AZERTY" | "JCUKEN" | "QWERTZ";
|
|
456
|
+
export type NavigatableContainer = Container;
|
|
457
|
+
export type NavigationDirection = "navigateLeft" | "navigateRight" | "navigateUp" | "navigateDown";
|
|
458
|
+
export type NavigationIntent = "navigateBack" | "navigateDown" | "navigateLeft" | "navigateRight" | "navigateUp" | "trigger";
|
|
459
|
+
export type NavigationTargetEvent = "focus" | "blur";
|
|
460
|
+
|
|
461
|
+
export {};
|