docs: rebuild Input API content

This commit is contained in:
2026-03-26 17:39:53 +08:00
parent ec4edb2689
commit ce2eee32e3
54 changed files with 1108 additions and 941 deletions

View File

@@ -1,31 +1,32 @@
# InputManager::GetTouch
获取相关状态或对象
读取指定索引的触点状态
```cpp
TouchState GetTouch(int index) const;
```
该方法声明于 `XCEngine/Input/InputManager.h`,当前页面用于固定 `InputManager` 类目录下的方法级 canonical 路径。
## 行为说明
**参数:**
- `index` - 参数语义详见头文件声明。
如果 `index` 合法,当前实现返回 `m_touches[index]` 的拷贝;否则返回默认构造的 `TouchState{}`
**返回:** `TouchState` - 返回值语义详见头文件声明
由于当前公开代码路径并不会填充 `m_touches`,这个接口大多数情况下只会返回默认值
**示例:**
## 参数
- `index` - 触点索引。
## 返回值
- `TouchState` - 指定触点状态;非法索引时为默认构造值。
## 示例
```cpp
#include <XCEngine/Input/InputManager.h>
void Example() {
XCEngine::Input::InputManager object;
// 根据上下文补齐参数后调用 InputManager::GetTouch(...)。
(void)object;
}
auto touch = XCEngine::Input::InputManager::Get().GetTouch(0);
```
## 相关文档
- [返回类总览](InputManager.md)
- [返回模块目录](../Input.md)
- [返回类总览](InputManager.md)
- [GetTouchCount](GetTouchCount.md)