summaryrefslogtreecommitdiff
path: root/Runtime/Events/InputEvent.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-08 09:23:38 +0800
committerchai <chaifix@163.com>2021-11-08 09:23:38 +0800
commit138d3f4d3d6e2aaf5ba34f89af15ef85ea074357 (patch)
tree31ca6e8ea6d2e960e8d35f801bd92555942822e2 /Runtime/Events/InputEvent.h
parentefce5b6bd5c9d4f8214a71e0f7a7c35751710a4c (diff)
*misc
Diffstat (limited to 'Runtime/Events/InputEvent.h')
-rw-r--r--Runtime/Events/InputEvent.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/Runtime/Events/InputEvent.h b/Runtime/Events/InputEvent.h
new file mode 100644
index 0000000..5a5ed36
--- /dev/null
+++ b/Runtime/Events/InputEvent.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#include "Runtime/Lua/LuaHelper.h"
+#include "Runtime/Math/Math.h"
+
+enum EInputEventType
+{
+ InputEvent_MouseDown = 0,
+ InputEvent_MouseUp = 1,
+ InputEvent_MouseMove = 2,
+ InputEvent_MouseDrag = 3,
+ InputEvent_KeyDown = 4,
+ InputEvent_KeyUp = 5,
+ InputEvent_ScrollWheel = 6,
+ InputEvent_Repaint = 7,
+ InputEvent_Layout = 8,
+ InputEvent_DragUpdated = 9,
+ InputEvent_DragPerform = 10,
+ InputEvent_DragExited = 15,
+ InputEvent_Ignore = 11,
+ InputEvent_Used = 12,
+ InputEvent_ValidateCommand = 13,
+ InputEvent_ExecuteCommand = 14,
+ InputEvent_ContextClick = 16,
+ InputEvent_MouseEnterWindow = 20,
+ InputEvent_MouseLeaveWindow = 21,
+ InputEvent_MagnifyGesture = 1000,
+ InputEvent_SwipeGesture = 1001,
+ InputEvent_RotateGesture = 1002
+};
+
+// ÊäÈëʼþ
+struct InputEvent : public LuaBind::INativeTable
+{
+ EInputEventType type;
+
+ Vector2f mousePosition;
+ Vector2f mouseDelta;
+
+ int button; ///< mouse button number. (bitfield of MouseButton enum)
+ int modifiers; ///< keyboard modifier flags. (bitfield of Modifiers enum)
+ float pressure; ///< Stylus pressure.
+ int clickCount;
+ uint16_t character; ///< unicode keyboard character (with modifiers).
+ uint16_t keycode; ///< The keyboard scancode of the event.
+ int displayIndex; ///< Display index to which this event belongs.
+ char* commandString;
+ bool keyRepeat; ///< Is the event the result of key repeat?
+
+ bool use;
+
+ void CastToTable(LuaBind::State& state) override;
+
+}; \ No newline at end of file