docs: sync api and planning docs
This commit is contained in:
37
docs/api/XCEngine/Input/InputManager/IsAnyKeyDown.md
Normal file
37
docs/api/XCEngine/Input/InputManager/IsAnyKeyDown.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# InputManager::IsAnyKeyDown
|
||||
|
||||
查询是否存在任意键盘键或鼠标按键当前处于按住状态。
|
||||
|
||||
```cpp
|
||||
bool IsAnyKeyDown() const;
|
||||
```
|
||||
|
||||
## 行为说明
|
||||
|
||||
当前实现会:
|
||||
|
||||
- 如果未初始化,返回 `false`
|
||||
- 先扫描 `m_keyDown`
|
||||
- 再扫描 `m_mouseButtonDown`
|
||||
- 任一数组里存在 `true` 就返回 `true`
|
||||
|
||||
这意味着当前 “any key” 的统计范围并不只限于键盘,鼠标按键也会让它成立。
|
||||
|
||||
## 返回值
|
||||
|
||||
- `bool` - 当前是否存在任意键盘键或鼠标按键处于按住状态。
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
if (XCEngine::Input::InputManager::Get().IsAnyKeyDown()) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [返回类型总览](InputManager.md)
|
||||
- [IsAnyKeyPressed](IsAnyKeyPressed.md)
|
||||
- [IsKeyDown](IsKeyDown.md)
|
||||
- [IsMouseButtonDown](IsMouseButtonDown.md)
|
||||
Reference in New Issue
Block a user