diff options
author | chai <chaifix@163.com> | 2019-08-04 17:19:51 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-04 17:19:51 +0800 |
commit | 7638df1ed1f0f314d78bd42e0aba084ba14ade0a (patch) | |
tree | d27bfdebae13e750307520232d5e003a140518a6 /source/Asura.Editor/System/Input.h | |
parent | bad78945ceba425f6a80e3b8dca2414d592970eb (diff) |
*misc
Diffstat (limited to 'source/Asura.Editor/System/Input.h')
-rw-r--r-- | source/Asura.Editor/System/Input.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source/Asura.Editor/System/Input.h b/source/Asura.Editor/System/Input.h new file mode 100644 index 0000000..682e69f --- /dev/null +++ b/source/Asura.Editor/System/Input.h @@ -0,0 +1,45 @@ +#ifndef _ASRUA_EDITOR_INPUT_H_ +#define _ASRUA_EDITOR_INPUT_H_ + +#include <windows.h> + +#include <asura-utils/Classes.h> +#include <asura-utils/Math/Vector2.hpp> +#include <asura-core/Input/InputDevice.h> + +namespace_begin(AsuraEditor) + +// Win32 input entry +class Input : public AEInput::InputDevice +{ +public: + + Input(); + ~Input(); + + bool Open(HWND window); + void Close(void); + + bool GetJoystickNames(std::vector<std::string> &names); + + bool Activate(bool active); + bool ToggleFullscreen(bool fullscreen, HWND window); + + bool Process(bool discard); + LRESULT OnKey(HWND window, UINT message, WPARAM wParam, LPARAM lParam); + LRESULT OnInput(HWND window, UINT message, WPARAM wParam, LPARAM lParam); + LRESULT OnDeviceChange(LPCWSTR name, bool add); + + static bool ConvertPositionToClientAreaCoord(HWND activeWindow, POINT position, AEMath::Vector2f& newPos); + +private: + + bool UpdateState(); + +}; + +extern Input g_Input; + +namespace_end + +#endif
\ No newline at end of file |