Files
小坤 1d963e8307
Some checks failed
Deploy VitePress to AliYun OSS / build-and-deploy (push) Has been cancelled
补充3.7版本文档:物理系统API/事件/枚举值、游戏设置事件、物品ID变更、物理使用指南
2026-03-02 00:17:03 +08:00

110 lines
2.8 KiB
Markdown

---
sidebarDepth: 1
---
# 游戏设置
# 索引
| 事件 | <div style="width: 3em"></div> | 描述 |
| --- | --- | --- |
| [OnCustomGamepadChangedEvent](游戏设置.md#oncustomgamepadchangedevent) | <span style="display:inline;color:#7575f9">客户端</span> | 当自定义手柄按键绑定发生改变时触发 |
| [OnCustomGamepadPressInGame](游戏设置.md#oncustomgamepadpressingame) | <span style="display:inline;color:#7575f9">客户端</span> | 当玩家按下自定义手柄按键时触发 |
| [OnCustomKeyChangedEvent](游戏设置.md#oncustomkeychangedevent) | <span style="display:inline;color:#7575f9">客户端</span> | 当自定义按键绑定发生改变时触发 |
| [OnCustomKeyPressInGame](游戏设置.md#oncustomkeypressingame) | <span style="display:inline;color:#7575f9">客户端</span> | 当玩家按下自定义按键时触发 |
# 游戏设置
## OnCustomGamepadChangedEvent
<span style="display:inline;color:#7575f9">客户端</span>
- 描述
当自定义手柄按键绑定发生改变时触发
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| name | str | 按键名称 |
| oldKey | str | 旧的键码 |
| newKey | str | 新的键码 |
- 返回值
## OnCustomGamepadPressInGame
<span style="display:inline;color:#7575f9">客户端</span>
- 描述
当玩家按下自定义手柄按键时触发
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| name | str | 按键名称 |
| key | str | 键码 |
| category | str | 按键分类 |
| isDown | str | 按下状态 ("1"为按下, "0"为抬起),仅普通按键有效 |
| magnitude | float | 扳机力度 (0.0-1.0),仅扳机键有效 |
| x | float | 摇杆X轴偏移 (-1.0-1.0),仅摇杆键有效 |
| y | float | 摇杆Y轴偏移 (-1.0-1.0),仅摇杆键有效 |
| screenName | str | 当前屏幕名称 |
- 返回值
## OnCustomKeyChangedEvent
<span style="display:inline;color:#7575f9">客户端</span>
- 描述
当自定义按键绑定发生改变时触发
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| name | str | 按键名称 |
| oldKey | str | 旧的键码 |
| newKey | str | 新的键码 |
- 返回值
## OnCustomKeyPressInGame
<span style="display:inline;color:#7575f9">客户端</span>
- 描述
当玩家按下自定义按键时触发
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| name | str | 按键名称 |
| key | str | 键码 |
| category | str | 按键分类 |
| isDown | str | 按下状态 ("1"为按下, "0"为抬起) |
| screenName | str | 当前屏幕名称 |
- 返回值