docs: rebuild Input API content
This commit is contained in:
@@ -1,31 +1,35 @@
|
||||
# InputManager::RegisterAxis
|
||||
|
||||
注册对象、回调或映射。
|
||||
注册或覆盖一个具名逻辑轴。
|
||||
|
||||
```cpp
|
||||
void RegisterAxis(const InputAxis& axis);
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Input/InputManager.h`,当前页面用于固定 `InputManager` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `axis` - 参数语义详见头文件声明。
|
||||
|
||||
**返回:** `void` - 无返回值。
|
||||
|
||||
**示例:**
|
||||
当前实现会执行:
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Input/InputManager.h>
|
||||
|
||||
void Example() {
|
||||
XCEngine::Input::InputManager object;
|
||||
// 根据上下文补齐参数后调用 InputManager::RegisterAxis(...)。
|
||||
(void)object;
|
||||
}
|
||||
m_axes[axis.GetName()] = axis;
|
||||
```
|
||||
|
||||
因此:
|
||||
|
||||
- 同名轴会被覆盖
|
||||
- `InputAxis` 会按值复制进管理器
|
||||
- 后续再修改原始 `axis` 对象不会影响管理器中的副本
|
||||
|
||||
## 参数
|
||||
|
||||
- `axis` - 轴配置对象。
|
||||
|
||||
## 返回值
|
||||
|
||||
- 无。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](InputManager.md)
|
||||
- [返回模块目录](../Input.md)
|
||||
- [返回类型总览](InputManager.md)
|
||||
- [GetAxis](GetAxis.md)
|
||||
- [ClearAxes](ClearAxes.md)
|
||||
|
||||
Reference in New Issue
Block a user