@vnejs/docs 0.2.6 → 0.2.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/docs",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "VNEJS documentation for engine consumers and coding agents",
5
5
  "files": [
6
6
  "*.md",
@@ -20,6 +20,54 @@
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.js применяет **один** `customButtonMapping` ко всем устройствам. На Steam Deck часто видны сразу два пада (raw HID + Steam Input Xbox virtual) — события с «кривого» сырого пада ломают кнопки.
44
+
45
+ Поэтому плагин:
46
+
47
+ 1. На `init` / `connect` / `disconnect` выбирает **preferred** пад: сначала `mapping === "standard"`, иначе Deck/Valve id, иначе первый.
48
+ 2. Ставит `joypad.set({ customButtonMapping })` только по профилю этого пада.
49
+ 3. Игнорирует `button_press` / `button_release` с других `gamepad.index`.
50
+
51
+ Приоритет профиля: `steam-deck` → `playstation` → `nintendo` → `firefox` → `standard`.
52
+
53
+ | Профиль | Когда | Что делает |
54
+ |---------|-------|------------|
55
+ | `standard` | по умолчанию; preferred с `mapping: "standard"` | identity |
56
+ | `steam-deck` | preferred без standard + id Deck/Steam (`28de` / `valve` / …) или `?steamDeck=1` | raw HID Deck → W3C |
57
+ | `playstation` | `mapping !== "standard"` и id PS | raw Square-first → W3C |
58
+ | `nintendo` | id Nintendo/Switch, в т.ч. при `standard` | A/B и X/Y под Nintendo confirm |
59
+ | `firefox` | Firefox UA и не сработал device-профиль | индексы из доки joypad.js |
60
+
61
+ Electron при `STEAM_DECK=1` добавляет в URL `?steamDeck=1` (подсказка для raw-only случая).
62
+
63
+ Все маппинги — объект `CUSTOM_BUTTON_MAPPING` в `plugins/controls/gamepad/src/profiles/custom-button-mapping.ts`:
64
+
65
+ - `CUSTOM_BUTTON_MAPPING.STANDARD` — `null` (identity)
66
+ - `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
67
+ - `CUSTOM_BUTTON_MAPPING.PLAYSTATION` — Cross←1, Circle←2, Square←0, Triangle←3; L1…R3 → 4…11
68
+ - `CUSTOM_BUTTON_MAPPING.NINTENDO` — ACCEPT←1 (A), BACK←0 (B), INTERACT←3 (X), MENU←2 (Y)
69
+ - `CUSTOM_BUTTON_MAPPING.FIREFOX` — `button_0`←1, `button_7`←11, `button_8`←12
70
+
23
71
  ## Модули
24
72
 
25
73
  | Модуль | Зона ответственности |