919 B
919 B
InputManager::IsMouseButtonReleased
查询鼠标按键是否在本帧刚被释放。
bool IsMouseButtonReleased(MouseButton button) const;
行为说明
当前实现会:
- 如果未初始化,返回
false - 把
MouseButton强转成数组下标 - 如果下标越界,返回
false - 否则返回
m_mouseButtonUpThisFrame[index]
这个标志位由 ProcessMouseButton 在 pressed == false 时写入,并会在 Update 时被清空。
参数
button- 要查询的鼠标按键。
返回值
bool- 当前帧是否刚被释放。
示例
bool released =
XCEngine::Input::InputManager::Get().IsMouseButtonReleased(XCEngine::Input::MouseButton::Left);