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

27 lines
545 B
Markdown

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