@vnejs/docs 0.2.7 → 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.7",
3
+ "version": "0.2.8",
4
4
  "description": "VNEJS documentation for engine consumers and coding agents",
5
5
  "files": [
6
6
  "*.md",
@@ -38,21 +38,27 @@
38
38
  | `button_9` | Menu / Start | `MENU` |
39
39
  | `button_12`…`15` | D-pad | `ARROW_*` |
40
40
 
41
- ## Профили
41
+ ## Профили и активный пад
42
42
 
43
- На `joypad` `connect` выбирается профиль и, при необходимости, вызывается `joypad.set({ customButtonMapping })`.
43
+ joypad.js применяет **один** `customButtonMapping` ко всем устройствам. На Steam Deck часто видны сразу два пада (raw HID + Steam Input Xbox virtual) — события с «кривого» сырого пада ломают кнопки.
44
44
 
45
- Приоритет: `steam-deck` → `playstation` → `nintendo` → `firefox` → `standard`.
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`.
46
52
 
47
53
  | Профиль | Когда | Что делает |
48
54
  |---------|-------|------------|
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 |
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 |
53
59
  | `firefox` | Firefox UA и не сработал device-профиль | индексы из доки joypad.js |
54
60
 
55
- Если Steam Input / браузер отдаёт корректный `STANDARD GAMEPAD` для Xbox/PS — обычно остаётся `standard` (для PS при `mapping === "standard"` playstation-профиль не включается).
61
+ Electron при `STEAM_DECK=1` добавляет в URL `?steamDeck=1` (подсказка для raw-only случая).
56
62
 
57
63
  Все маппинги — объект `CUSTOM_BUTTON_MAPPING` в `plugins/controls/gamepad/src/profiles/custom-button-mapping.ts`:
58
64