docs: rebuild Input API content
This commit is contained in:
@@ -1,32 +1,26 @@
|
||||
# InputManager::RegisterButton
|
||||
|
||||
注册对象、回调或映射。
|
||||
注册或覆盖一个具名逻辑按钮。
|
||||
|
||||
```cpp
|
||||
void RegisterButton(const Containers::String& name, KeyCode key);
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Input/InputManager.h`,当前页面用于固定 `InputManager` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `name` - 参数语义详见头文件声明。
|
||||
- `key` - 参数语义详见头文件声明。
|
||||
当前实现只保存 `name -> key` 的映射关系,不会创建更复杂的动作状态机。逻辑按钮本质上只是一个有名字的 `KeyCode` 别名。
|
||||
|
||||
**返回:** `void` - 无返回值。
|
||||
## 参数
|
||||
|
||||
**示例:**
|
||||
- `name` - 逻辑按钮名称。
|
||||
- `key` - 对应的按键。
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Input/InputManager.h>
|
||||
## 返回值
|
||||
|
||||
void Example() {
|
||||
XCEngine::Input::InputManager object;
|
||||
// 根据上下文补齐参数后调用 InputManager::RegisterButton(...)。
|
||||
(void)object;
|
||||
}
|
||||
```
|
||||
- 无。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](InputManager.md)
|
||||
- [返回模块目录](../Input.md)
|
||||
- [返回类型总览](InputManager.md)
|
||||
- [GetButton](GetButton.md)
|
||||
- [ClearAxes](ClearAxes.md)
|
||||
|
||||
Reference in New Issue
Block a user