Files
XCEngine/docs/api/XCEngine/Input/InputManager/RegisterButton.md

27 lines
545 B
Markdown
Raw Normal View History

2026-03-26 16:45:24 +08:00
# InputManager::RegisterButton
2026-03-26 17:39:53 +08:00
注册或覆盖一个具名逻辑按钮。
2026-03-26 16:45:24 +08:00
```cpp
void RegisterButton(const Containers::String& name, KeyCode key);
```
2026-03-26 17:39:53 +08:00
## 行为说明
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
当前实现只保存 `name -> key` 的映射关系,不会创建更复杂的动作状态机。逻辑按钮本质上只是一个有名字的 `KeyCode` 别名。
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
## 参数
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
- `name` - 逻辑按钮名称。
- `key` - 对应的按键。
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
## 返回值
2026-03-26 16:45:24 +08:00
2026-03-26 17:39:53 +08:00
- 无。
2026-03-26 16:45:24 +08:00
## 相关文档
2026-03-26 17:39:53 +08:00
- [返回类型总览](InputManager.md)
- [GetButton](GetButton.md)
- [ClearAxes](ClearAxes.md)