docs: rebuild Input API content
This commit is contained in:
@@ -1,34 +1,36 @@
|
||||
# InputManager::ProcessMouseButton
|
||||
|
||||
公开方法,详见头文件声明。
|
||||
向输入系统注入一个鼠标按键事件。
|
||||
|
||||
```cpp
|
||||
void ProcessMouseButton(MouseButton button, bool pressed, int x, int y);
|
||||
```
|
||||
|
||||
该方法声明于 `XCEngine/Input/InputManager.h`,当前页面用于固定 `InputManager` 类目录下的方法级 canonical 路径。
|
||||
## 行为说明
|
||||
|
||||
**参数:**
|
||||
- `button` - 参数语义详见头文件声明。
|
||||
- `pressed` - 参数语义详见头文件声明。
|
||||
- `x` - 参数语义详见头文件声明。
|
||||
- `y` - 参数语义详见头文件声明。
|
||||
当前实现会:
|
||||
|
||||
**返回:** `void` - 无返回值。
|
||||
- 如果未初始化或按钮索引越界,直接返回
|
||||
- 把 `m_mouseButtonDown[index]` 更新为 `pressed`
|
||||
- 只有在 `pressed == true` 时,才把 `m_mouseButtonDownThisFrame[index]` 设为 `true`
|
||||
- 构造 `MouseButtonEvent`
|
||||
- 同步触发 `m_onMouseButton`
|
||||
|
||||
**示例:**
|
||||
这意味着当前实现只显式记录“按下边沿”,没有单独的 “mouse up this frame” 缓存。
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Input/InputManager.h>
|
||||
## 参数
|
||||
|
||||
void Example() {
|
||||
XCEngine::Input::InputManager object;
|
||||
// 根据上下文补齐参数后调用 InputManager::ProcessMouseButton(...)。
|
||||
(void)object;
|
||||
}
|
||||
```
|
||||
- `button` - 鼠标按键。
|
||||
- `pressed` - `true` 表示按下,`false` 表示释放。
|
||||
- `x` - 事件位置 X。
|
||||
- `y` - 事件位置 Y。
|
||||
|
||||
## 返回值
|
||||
|
||||
- 无。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类总览](InputManager.md)
|
||||
- [返回模块目录](../Input.md)
|
||||
- [返回类型总览](InputManager.md)
|
||||
- [OnMouseButton](OnMouseButton.md)
|
||||
- [IsMouseButtonClicked](IsMouseButtonClicked.md)
|
||||
|
||||
Reference in New Issue
Block a user