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

@@ -6,29 +6,39 @@
**头文件**: `XCEngine/Input/InputModule.h`
**描述**: 定义 `XCEngine/Input` 子目录中的 `InputModule` public API
**描述**: 定义平台输入桥接层的最小接口,把操作系统消息翻译成 `InputManager` 可消费的调用
## 概述
`InputModule.h` `XCEngine/Input` 子目录 下的 public header当前页面作为平行目录中的 canonical 总览,用于汇总该头文件暴露的主要声明
`InputModule` 代表“输入后端适配器”这一层。它本身不保存全局输入状态,职责是从平台窗口系统接收原始消息,然后调用 `InputManager::Process*` 把这些消息转换成引擎内部统一格式
## 声明概览
这层拆分的价值在于:
| 声明 | 类型 | 说明 |
|------|------|------|
| `InputModule` | `class` | 头文件中的公开声明。 |
- 游戏代码只依赖 `InputManager`,不直接依赖 Win32、GLFW 或其它平台 API。
- 各平台后端可以各自决定如何接收事件,但最后都汇总到同一套引擎输入状态。
## 公共方法
## 当前实现中的位置
| 方法 | 描述 |
- [WindowsInputModule](../../Platform/Windows/WindowsInputModule/WindowsInputModule.md) 是当前代码库里的实际实现。
- `InputModule` 本身只定义抽象接口,不提供默认逻辑。
## 线程语义
- 具体线程语义取决于平台后端。
- 当前 Windows 路径假定输入消息和 `InputManager` 更新都发生在窗口线程或主线程。
## 公开方法
| 方法 | 说明 |
|------|------|
| [~InputModule()](Destructor.md) | 销毁对象并释放相关资源。 |
| [Initialize](Initialize.md) | 初始化内部状态。 |
| [Shutdown](Shutdown.md) | 关闭并清理内部状态。 |
| [PumpEvents](PumpEvents.md) | 公开方法,详见头文件声明。 |
| [HandleMessage](HandleMessage.md) | 公开方法,详见头文件声明。 |
| [Destructor](Destructor.md) | 虚析构函数。 |
| [Initialize](Initialize.md) | 初始化平台输入后端。 |
| [Shutdown](Shutdown.md) | 关闭平台输入后端。 |
| [PumpEvents](PumpEvents.md) | 主动轮询平台事件。 |
| [HandleMessage](HandleMessage.md) | 处理一条平台消息。 |
## 相关文档
- [当前目录](../Input.md) - 返回 `Input` 平行目录
- [API 总索引](../../../main.md) - 返回顶层索引
- [当前模块](../Input.md)
- [WindowsInputModule](../../Platform/Windows/WindowsInputModule/WindowsInputModule.md)
- [Input Flow And Frame Semantics](../../../_guides/Input/Input-Flow-and-Frame-Semantics.md)