![]() |
Kiwano Engine v1.3.x
|
输入设备实例,可获取鼠标和键盘的按键状态 更多...
#include <Input.h>
Public 成员函数 | |
| bool | IsDown (KeyCode key) const |
| 检测键盘按键是否正被按下 更多... | |
| bool | WasPressed (KeyCode key) const |
| 检测键盘按键是否刚被点击 更多... | |
| bool | WasReleased (KeyCode key) const |
| 检测键盘按键是否刚抬起 更多... | |
| bool | IsDown (MouseButton btn) const |
| 检测鼠标按键是否正被按下 更多... | |
| bool | WasPressed (MouseButton btn) const |
| 检测鼠标按键是否刚被点击 更多... | |
| bool | WasReleased (MouseButton btn) const |
| 检测鼠标按键是否刚抬起 更多... | |
| float | GetMouseX () const |
| 获得鼠标 x 坐标 更多... | |
| float | GetMouseY () const |
| 获得鼠标 y 坐标 更多... | |
| Point | GetMousePos () const |
| 获得鼠标坐标 更多... | |
| void | OnUpdate (UpdateModuleContext &ctx) override |
| 更新时 更多... | |
| void | HandleEvent (EventModuleContext &ctx) override |
| 事件处理 更多... | |
Public 成员函数 继承自 kiwano::Module | |
| virtual void | SetupModule () |
| 启动模块 更多... | |
| virtual void | DestroyModule () |
| 销毁模块 更多... | |
| virtual void | OnUpdate (UpdateModuleContext &ctx) |
| 更新时 更多... | |
| virtual void | HandleEvent (EventModuleContext &ctx) |
| 事件处理 更多... | |
| virtual void | BeforeRender (RenderModuleContext &ctx) |
| 渲染前 更多... | |
| virtual void | OnRender (RenderModuleContext &ctx) |
| 渲染时 更多... | |
| virtual void | AfterRender (RenderModuleContext &ctx) |
| 渲染后 更多... | |
额外继承的成员函数 | |
Public 类型 继承自 kiwano::Singleton< Input > | |
| using | object_type = Input |
静态 Public 成员函数 继承自 kiwano::Singleton< Input > | |
| static object_type & | GetInstance () |
| static object_type * | GetInstancePtr () |
Protected 成员函数 继承自 kiwano::Singleton< Input > | |
| Singleton (const Singleton &)=delete | |
| Singleton & | operator= (const Singleton &)=delete |
静态 Protected 属性 继承自 kiwano::Singleton< Input > | |
| static Input | instance_ |
输入设备实例,可获取鼠标和键盘的按键状态
| Point kiwano::Input::GetMousePos | ( | ) | const |
获得鼠标坐标
| float kiwano::Input::GetMouseX | ( | ) | const |
获得鼠标 x 坐标
| float kiwano::Input::GetMouseY | ( | ) | const |
获得鼠标 y 坐标
|
overridevirtual |
| bool kiwano::Input::IsDown | ( | KeyCode | key | ) | const |
检测键盘按键是否正被按下
| key | 键值 |
| bool kiwano::Input::IsDown | ( | MouseButton | btn | ) | const |
检测鼠标按键是否正被按下
| btn | 鼠标键值 |
|
overridevirtual |
| bool kiwano::Input::WasPressed | ( | KeyCode | key | ) | const |
检测键盘按键是否刚被点击
| key | 键值 |
| bool kiwano::Input::WasPressed | ( | MouseButton | btn | ) | const |
检测鼠标按键是否刚被点击
| btn | 鼠标键值 |
| bool kiwano::Input::WasReleased | ( | KeyCode | key | ) | const |
检测键盘按键是否刚抬起
| key | 键值 |
| bool kiwano::Input::WasReleased | ( | MouseButton | btn | ) | const |
检测鼠标按键是否刚抬起
| btn | 鼠标键值 |