@vnejs/docs 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/controls/gamepad.md +42 -0
package/package.json
CHANGED
|
@@ -20,6 +20,48 @@
|
|
|
20
20
|
|
|
21
21
|
Нет.
|
|
22
22
|
|
|
23
|
+
## Маппинг кнопок (W3C / Xbox standard)
|
|
24
|
+
|
|
25
|
+
После того как joypad выдаёт логическое имя `button_N`, плагин эмитит ключи в `CONTROLS.EMIT`:
|
|
26
|
+
|
|
27
|
+
| joypad | Физическая (standard) | Абстрактный control |
|
|
28
|
+
|--------|----------------------|---------------------|
|
|
29
|
+
| `button_0` | A / Cross (низ) | `ACCEPT` |
|
|
30
|
+
| `button_1` | B / Circle (право) | `BACK` |
|
|
31
|
+
| `button_2` | X / Square (лево) | `INTERACT` |
|
|
32
|
+
| `button_3` | Y / Triangle (верх) | `MENU` |
|
|
33
|
+
| `button_4` | LB / L1 | `TAB_PREV` |
|
|
34
|
+
| `button_5` | RB / R1 | `TAB_NEXT` |
|
|
35
|
+
| `button_6` | LT / L2 | `FASTFORWARD_START` / `FASTFORWARD_FINISH` |
|
|
36
|
+
| `button_7` | RT / R2 | (cursor click через compatibility) |
|
|
37
|
+
| `button_8` | View / Select | `GAMEMENU` |
|
|
38
|
+
| `button_9` | Menu / Start | `MENU` |
|
|
39
|
+
| `button_12`…`15` | D-pad | `ARROW_*` |
|
|
40
|
+
|
|
41
|
+
## Профили
|
|
42
|
+
|
|
43
|
+
На `joypad` `connect` выбирается профиль и, при необходимости, вызывается `joypad.set({ customButtonMapping })`.
|
|
44
|
+
|
|
45
|
+
Приоритет: `steam-deck` → `playstation` → `nintendo` → `firefox` → `standard`.
|
|
46
|
+
|
|
47
|
+
| Профиль | Когда | Что делает |
|
|
48
|
+
|---------|-------|------------|
|
|
49
|
+
| `standard` | по умолчанию | identity (сырой индекс = logical `button_N`) |
|
|
50
|
+
| `steam-deck` | `mapping !== "standard"` и id Deck/Steam (`steam deck` / `valve` / `jupiter` / `28de`) | raw HID Deck → W3C |
|
|
51
|
+
| `playstation` | `mapping !== "standard"` и id PS (`dualsense` / `dualshock` / `054c` / …) | raw Square-first layout → W3C |
|
|
52
|
+
| `nintendo` | id Nintendo/Switch (`nintendo` / `switch` / `057e` / …), в т.ч. при `standard` | A/B и X/Y под Nintendo confirm |
|
|
53
|
+
| `firefox` | Firefox UA и не сработал device-профиль | индексы из доки joypad.js |
|
|
54
|
+
|
|
55
|
+
Если Steam Input / браузер отдаёт корректный `STANDARD GAMEPAD` для Xbox/PS — обычно остаётся `standard` (для PS при `mapping === "standard"` playstation-профиль не включается).
|
|
56
|
+
|
|
57
|
+
Все маппинги — объект `CUSTOM_BUTTON_MAPPING` в `plugins/controls/gamepad/src/profiles/custom-button-mapping.ts`:
|
|
58
|
+
|
|
59
|
+
- `CUSTOM_BUTTON_MAPPING.STANDARD` — `null` (identity)
|
|
60
|
+
- `CUSTOM_BUTTON_MAPPING.STEAM_DECK` — A→7, B→5, X→6, Y→4, LB→3, RB→2, LT→1, RT→0, Select→12, Start→14, D-pad → 8/11/10/9
|
|
61
|
+
- `CUSTOM_BUTTON_MAPPING.PLAYSTATION` — Cross←1, Circle←2, Square←0, Triangle←3; L1…R3 → 4…11
|
|
62
|
+
- `CUSTOM_BUTTON_MAPPING.NINTENDO` — ACCEPT←1 (A), BACK←0 (B), INTERACT←3 (X), MENU←2 (Y)
|
|
63
|
+
- `CUSTOM_BUTTON_MAPPING.FIREFOX` — `button_0`←1, `button_7`←11, `button_8`←12
|
|
64
|
+
|
|
23
65
|
## Модули
|
|
24
66
|
|
|
25
67
|
| Модуль | Зона ответственности |
|