From 7638df1ed1f0f314d78bd42e0aba084ba14ade0a Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 4 Aug 2019 17:19:51 +0800 Subject: *misc --- source/modules/asura-core/Input/InputDevice.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'source/modules/asura-core/Input/InputDevice.h') diff --git a/source/modules/asura-core/Input/InputDevice.h b/source/modules/asura-core/Input/InputDevice.h index 39f3d37..0ecce99 100644 --- a/source/modules/asura-core/Input/InputDevice.h +++ b/source/modules/asura-core/Input/InputDevice.h @@ -8,29 +8,35 @@ #include "../CoreConfig.h" #include "KeyboardState.h" +#include "MouseState.h" +#include "JoystickState.h" namespace_begin(AsuraEngine) namespace_begin(Input) -/// 不同平台继承这个基类并实现handle接口 -ASURA_ABSTRACT class InputDevice : public Singleton +class InputDevice { -protected: +public: - void OnKeyDown(int key); - void OnKeyUp(int key); + InputDevice(); + virtual ~InputDevice(); - void OnMouseMove(const AEMath::Vector2f& position); +protected: - void OnMouseButtonDown(int key); - void OnMouseButtonUp(int key); + virtual bool UpdateState(); - void OnMouseWheel(); + MouseState m_Mouse; + KeyboardState m_Keyboard; + JoystickState m_Joysticks; - void OnInputChar(); +private: + + bool UpdateMousePosition(); }; +//bool ConvertPositionToClientAreaCoord(); + namespace_end namespace_end -- cgit v1.1-26-g67d0