diff options
author | chai <chaifix@163.com> | 2021-11-12 19:13:03 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-12 19:13:03 +0800 |
commit | 9b1f8214eea0c86d41f903a5feba9aac78603df1 (patch) | |
tree | e4459ce952c6059f8663bc6039c3eee2bc74c949 | |
parent | bfbe1b31322030d0af6f4d010f578c0b3b3dde21 (diff) |
*misc
21 files changed, 247 insertions, 75 deletions
diff --git a/Data/DefaultContent/Libraries/GameLab/Debug/init.lua b/Data/DefaultContent/Libraries/GameLab/Debug/init.lua new file mode 100644 index 0000000..47a507d --- /dev/null +++ b/Data/DefaultContent/Libraries/GameLab/Debug/init.lua @@ -0,0 +1,5 @@ +local Debug = GameLab.Debug or {}
+GameLab.Debug = Debug
+
+
+return Debug
\ No newline at end of file diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/GUI/IMGUI.lua b/Data/DefaultContent/Libraries/GameLab/Engine/GUI/IMGUI.lua index 2b763e7..33299a2 100644 --- a/Data/DefaultContent/Libraries/GameLab/Engine/GUI/IMGUI.lua +++ b/Data/DefaultContent/Libraries/GameLab/Engine/GUI/IMGUI.lua @@ -7,7 +7,8 @@ local Event = GameLab.Events.Event local imgui = {
currentId = 0, -- 当前可分配的controlID
-}
+ hotControl = 0,
+}
GUI.GetControlID = function()
imgui.currentId = imgui.currentId + 1
@@ -31,6 +32,14 @@ GUI.EndFrame = function() end
+GUI.SetHotControl = function(id)
+ imgui.hotControl = id
+end
+
+GUI.GetHotControl = function()
+ return imgui.hotControl
+end
+
------------------------------------------------------------------------------------------------
-- 控件
------------------------------------------------------------------------------------------------
diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/GUI/init.lua b/Data/DefaultContent/Libraries/GameLab/Engine/GUI/init.lua index 4b83ddc..4424a2a 100644 --- a/Data/DefaultContent/Libraries/GameLab/Engine/GUI/init.lua +++ b/Data/DefaultContent/Libraries/GameLab/Engine/GUI/init.lua @@ -1,3 +1,3 @@ local import = GameLab.import(...)
-import("IMGUI")
+import("imgui")
diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/Math/Rect.lua b/Data/DefaultContent/Libraries/GameLab/Engine/Math/Rect.lua index ba18637..e52f8f0 100644 --- a/Data/DefaultContent/Libraries/GameLab/Engine/Math/Rect.lua +++ b/Data/DefaultContent/Libraries/GameLab/Engine/Math/Rect.lua @@ -14,6 +14,16 @@ Rect.Set = function(self, rect) self.w = rect.w or rect[4]
end
+Rect.GetPosition = function(self)
+ local v = GameLab.Engine.Math.Vector2.New(self.x, self.y)
+ return v
+end
+
+Rect.GetSize = function(self)
+ local v = GameLab.Engine.Math.Vector2.New(self.width, self.height)
+ return v
+end
+
Rect.CopyFrom = function(self, rect)
self.x = rect.x
self.y = rect.y
@@ -22,7 +32,8 @@ Rect.CopyFrom = function(self, rect) end
Rect.Contains = function(self, point)
-
+ return point.x >= self.x and point.x <= self.x + self.width
+ and point.y >= self.y and point.y <= self.y + self.height
end
return Rect
\ No newline at end of file diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua b/Data/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua index 9a0e0a3..eb4c14b 100644 --- a/Data/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua +++ b/Data/DefaultContent/Libraries/GameLab/Engine/Math/Vector2.lua @@ -5,4 +5,16 @@ Vector2.Ctor = function(self, x, y) self.y = y or 0
end
+Vector2.__add = function(self, other)
+ self.x = self.x + other.x
+ self.y = self.y + other.y
+ return self
+end
+
+Vector2.Add = function(self, other)
+ self.x = self.x + other.x
+ self.y = self.y + other.y
+ return self
+end
+
return Vector2
\ No newline at end of file diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua b/Data/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua deleted file mode 100644 index 664ecba..0000000 --- a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/EventCenter.lua +++ /dev/null @@ -1,23 +0,0 @@ -local EventCenter = {} - -EventCenter.Subscribe = function(event, callback) - -end - -EventCenter.Unsubscribe = function(event, callback) - -end - -EventCenter.UnsubscribeAll = function(event) - -end - -EventCenter.Publish = function(event, ...) - -end - -EventCenter.Clear = function() - -end - -Jin.EventCenter = EventCenter
\ No newline at end of file diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua b/Data/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua deleted file mode 100644 index e69de29..0000000 --- a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/StateMachine.lua +++ /dev/null diff --git a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua b/Data/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua deleted file mode 100644 index e69de29..0000000 --- a/Data/DefaultContent/Libraries/GameLab/Engine/Utils/Util.lua +++ /dev/null diff --git a/Data/DefaultContent/Libraries/GameLab/Utils/init.lua b/Data/DefaultContent/Libraries/GameLab/Utils/init.lua new file mode 100644 index 0000000..0ca5131 --- /dev/null +++ b/Data/DefaultContent/Libraries/GameLab/Utils/init.lua @@ -0,0 +1,4 @@ +local utils = GameLab.Utils or {}
+GameLab.Utils = utils
+
+return uitls
\ No newline at end of file diff --git a/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua index cb05518..6f6335b 100644 --- a/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua +++ b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua @@ -1,15 +1,17 @@ local GUIWindow = GameLab.GlobalClass("GameLab.Editor.Window.GUIWindow")
local NativeGUIWindow = GameLab.Editor.Window.Internal.GUIWindow
-local inspect = require("inspect")
-
-local Debug = GameLab.Debug
-local GL = GameLab.Engine.GL
-local Math = GameLab.Engine.Math
-local Rendering = GameLab.Engine.Rendering
-
-local Rect = Math.Rect
-local Event = GameLab.Events.Event
+local inspect = require("inspect")
+local Debug = require("GameLab.Debug")
+local GL = require("GameLab.Engine.GL")
+local Math = require("GameLab.Engine.Math")
+local Rendering = require("GameLab.Engine.Rendering")
+local Utils = require("GameLab.Utils")
+local Events = require("GameLab.Events")
+
+local Rect = Math.Rect
+local Event = Events.Event
+local Vector2 = Math.Vector2
local i = 0
local col = {
@@ -22,7 +24,7 @@ GUIWindow.Ctor = function(self) self.m_Native = NativeGUIWindow.New(self)
self.m_ContainerWindow = nil
self.m_SplitWindow = nil -- parent window
- self.m_Position = Rect.New(0,0,0,0) -- 在父窗口中的位置和大小
+ self.m_Position = Rect.New(0,0,0,0) -- 在父ContainerWindow中的位置和大小
self.m_EditorWindows = {} -- 编辑器脚本
i = i + 1
@@ -34,11 +36,19 @@ GUIWindow.SetContainerWindow = function(self, containerWindow) self.m_Native:SetContainerWindow(containerWindow:GetNative())
end
+GUIWindow.AddEditorWindow = function(self)
+
+end
+
GUIWindow.SetPosition = function(self, pos)
self.m_Position:Set(pos)
self.m_Native:SetPosition(pos)
end
+GUIWindow.GetPosition = function(self)
+ return self.m_Position
+end
+
GUIWindow.GetNative = function(self)
return self.m_Native
end
@@ -48,8 +58,10 @@ GUIWindow.OnGUI = function(self) local event = Event.current
- if self.m_SplitWindow then
- self.m_SplitWindow:DoSplit(event)
+ if self.m_SplitWindow then
+ local e = Events.CopyEvent(event)
+ e.mousePosition:Add(self.m_Position:GetPosition())
+ self.m_SplitWindow:DoSplit(e)
end
end
diff --git a/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua b/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua index 597e858..9dd6446 100644 --- a/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua +++ b/Data/Libraries/GameLab/Editor/Window/SplitWindow.lua @@ -1,5 +1,7 @@ -local Debug = GameLab.Debug -local Rect = require("GameLab.Engine.Math.Rect") +local Debug = GameLab.Debug +local EEventType = GameLab.Events.EEventType +local Rect = require("GameLab.Engine.Math.Rect") +local GUI = require("GameLab.Engine.GUI") local Splitter = GameLab.Class("GameLab.Editor.Window.Internal.Splitter") @@ -22,21 +24,31 @@ SplitWindow.Ctor = function(self, mode, splitter) self.m_SubSplit = {} -- 子节点也是split windows self.m_GUIWindow = {} -- 不包含subSplit的有一个GUIWindow self.m_Splitter = {} + self.m_CurSplitter = nil self.m_ContainerWindow = nil if splitter ~= nil and type(splitter) == "table" then for _, v in ipairs(splitter) do local sp = Splitter.New(v) table.insert(self.m_Splitter, sp) end - end + end end -- 布局,设置GUIWindow的大小 SplitWindow.DoSplit = function(self, event) - -- local position = self:GetPosition() - -- for _, sp in ipairs(self.m_SubSplit) do - -- sp:DoSplit(event) - -- end + if self.m_Parent ~= nil then + self.m_Parent:DoSplit(event) + end + + local id = GUI.GetControlID() + + if event.type == EEventType.MouseDown then + + elseif event.type == EEventType.MouseDrag then + + elseif event.type == EEventType.MouseUp then + + end end -- 返回在containerWindow下的像素大小和位置 diff --git a/Data/boot.lua b/Data/boot.lua index 9d372c9..091aff0 100644 --- a/Data/boot.lua +++ b/Data/boot.lua @@ -24,6 +24,7 @@ end -- load gamelab modules
require "GameLab"
+require "GameLab.Utils"
require "GameLab.Events"
require "GameLab.Engine"
require "GameLab.Engine.GUI"
diff --git a/Editor/Scripting/EditorScripting.cpp b/Editor/Scripting/EditorScripting.cpp index 244dd78..12f591c 100644 --- a/Editor/Scripting/EditorScripting.cpp +++ b/Editor/Scripting/EditorScripting.cpp @@ -6,6 +6,7 @@ extern int luaopen_GameLab(lua_State* L); // GameLab extern int luaopen_GameLab_Debug(lua_State* L); // GameLab.Debug extern int luaopen_GameLab_IO(lua_State* L); // GameLab.IO extern int luaopen_GameLab_Path(lua_State* L); // GameLab.Path +extern int luaopen_GameLab_Events(lua_State* L); // GameLab.Events
extern int luaopen_GameLab_Engine(lua_State* L); // GameLab.Engine extern int luaopen_GameLab_Engine_Rendering(lua_State* L); // GameLab.Engine.Rendering @@ -39,7 +40,8 @@ bool SetupGameLabEditorScripting(lua_State* L) openlib(luaopen_GameLab_Debug); openlib(luaopen_GameLab_Path); - openlib(luaopen_GameLab_IO); + openlib(luaopen_GameLab_IO); + openlib(luaopen_GameLab_Events); openlib(luaopen_GameLab_Engine_Rendering); openlib(luaopen_GameLab_Engine_GL); diff --git a/Projects/VisualStudio/Editor/Editor.vcxproj b/Projects/VisualStudio/Editor/Editor.vcxproj index 7fab991..8e47f3a 100644 --- a/Projects/VisualStudio/Editor/Editor.vcxproj +++ b/Projects/VisualStudio/Editor/Editor.vcxproj @@ -228,6 +228,7 @@ <ClCompile Include="..\..\..\Runtime\Scripting\Common\Common.bind.cpp" />
<ClCompile Include="..\..\..\Runtime\Scripting\Common\DataBuffer.bind.cpp" />
<ClCompile Include="..\..\..\Runtime\Scripting\Debug\Debug.bind.cpp" />
+ <ClCompile Include="..\..\..\Runtime\Scripting\Events\Events.bind.cpp" />
<ClCompile Include="..\..\..\Runtime\Scripting\GL\GL.bind.cpp" />
<ClCompile Include="..\..\..\Runtime\Scripting\GUI\Font.bind.cpp" />
<ClCompile Include="..\..\..\Runtime\Scripting\GUI\GUI.bind.cpp" />
diff --git a/Projects/VisualStudio/Editor/Editor.vcxproj.filters b/Projects/VisualStudio/Editor/Editor.vcxproj.filters index a9af0ec..12b1aef 100644 --- a/Projects/VisualStudio/Editor/Editor.vcxproj.filters +++ b/Projects/VisualStudio/Editor/Editor.vcxproj.filters @@ -112,6 +112,9 @@ <Filter Include="Editor\Scripting\Window">
<UniqueIdentifier>{848489fc-f661-4b10-91f5-db1687293b95}</UniqueIdentifier>
</Filter>
+ <Filter Include="Runtime\Scripting\Events">
+ <UniqueIdentifier>{80fdf19a-6158-4fc0-8a3c-c86d51730261}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\Editor\GUI\Dock.cpp">
@@ -415,6 +418,9 @@ <ClCompile Include="..\..\..\Editor\Scripting\Window\SplitWindow.bind.cpp">
<Filter>Editor\Scripting\Window</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\Runtime\Scripting\Events\Events.bind.cpp">
+ <Filter>Runtime\Scripting\Events</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\Editor\GUI\Dock.h">
diff --git a/Runtime/Events/InputEvent.cpp b/Runtime/Events/InputEvent.cpp index 07d8778..e741511 100644 --- a/Runtime/Events/InputEvent.cpp +++ b/Runtime/Events/InputEvent.cpp @@ -3,6 +3,34 @@ #include "Editor/GUI/WindowUtil.h" #endif +namespace Events +{
+ bool IsMouseEvent(EInputEventType type) + { + switch (type) + { + case InputEvent_MouseDown: + case InputEvent_MouseUp: + case InputEvent_MouseMove: + case InputEvent_MouseDrag: + case InputEvent_ScrollWheel: + return true; + } + return false; + } + + bool IsKeyEvent(EInputEventType type) + { + switch (type) + { + case InputEvent_KeyDown: + case InputEvent_KeyUp: + return true; + } + return false; + } +} + static Vector2f GetInputMousePosition(HWND window) { #if GAMELAB_EDITOR @@ -25,70 +53,64 @@ static Vector2f GetInputMousePosition(HWND window) #endif } +InputEvent::InputEvent() +{ +} + InputEvent::InputEvent(UINT message, WPARAM wParam, LPARAM lParam, HWND window) { static Vector2f s_LastMousePos(0.0f, 0.0f); - isMouse = false, isKey = false; + clickCount = 0; switch (message) { case WM_LBUTTONDOWN: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_LeftButton; clickCount = 1; break; case WM_RBUTTONDOWN: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_RightButton; clickCount = 1; break; case WM_MBUTTONDOWN: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_MiddleButton; clickCount = 1; break; case WM_LBUTTONUP: type = InputEvent_MouseUp; - isMouse = true; button = Mouse_LeftButton; clickCount = 1; break; case WM_RBUTTONUP: type = InputEvent_MouseUp; - isMouse = true; button = Mouse_RightButton; clickCount = 1; break; case WM_MBUTTONUP: type = InputEvent_MouseUp; - isMouse = true; button = Mouse_MiddleButton; clickCount = 1; break; case WM_LBUTTONDBLCLK: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_LeftButton; clickCount = 2; break; case WM_RBUTTONDBLCLK: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_RightButton; clickCount = 2; break; case WM_MBUTTONDBLCLK: type = InputEvent_MouseDown; - isMouse = true; button = Mouse_MiddleButton; clickCount = 2; break; case WM_MOUSEMOVE: type = InputEvent_MouseMove; - isMouse = true; button = 0; if (wParam & MK_LBUTTON) { @@ -108,37 +130,30 @@ InputEvent::InputEvent(UINT message, WPARAM wParam, LPARAM lParam, HWND window) break; case WM_KEYUP: type = InputEvent_KeyUp; - isKey = true; break; case WM_KEYDOWN: type = InputEvent_KeyDown; - isKey = true; break; case WM_SYSKEYUP: type = InputEvent_KeyUp; - isKey = true; break; case WM_SYSKEYDOWN: type = InputEvent_KeyDown; - isKey = true; break; case WM_CHAR: if (!(lParam & (1 << 31))) // key is pressed { type = InputEvent_KeyDown; - isKey = true; } break; case WM_MOUSEWHEEL: mouseDelta.y = -GET_WHEEL_DELTA_WPARAM(wParam) / float(WHEEL_DELTA) * 3.0f; type = InputEvent_ScrollWheel; - isMouse = true; button = 0; break; case WM_MOUSEHWHEEL: mouseDelta.x = GET_WHEEL_DELTA_WPARAM(wParam) / float(WHEEL_DELTA) * 3.0f; type = InputEvent_ScrollWheel; - isMouse = true; button = 0; break; default: @@ -162,7 +177,7 @@ InputEvent::InputEvent(UINT message, WPARAM wParam, LPARAM lParam, HWND window) modifiers |= Modifier_CapsLock; } - if (isMouse) + if (Events::IsMouseEvent(type)) { Vector2f p = GetInputMousePosition(window); mousePosition = p; @@ -204,7 +219,7 @@ InputEvent::InputEvent(UINT message, WPARAM wParam, LPARAM lParam, HWND window) // handle keyboard character = keycode = 0; - if (isKey) + if (Events::IsKeyEvent(type)) { //if (message == WM_CHAR) //{ @@ -249,7 +264,7 @@ void InputEvent::CastToTable(LuaBind::State& state) const lua_pushnumber(state, type); lua_setfield(state, table, "type"); - // "used" + // "use" lua_pushboolean(state, use); lua_setfield(state, table, "use"); @@ -257,7 +272,7 @@ void InputEvent::CastToTable(LuaBind::State& state) const state.PushLuaObject(mousePosition); lua_setfield(state, table, "mousePosition"); - if (isMouse) + if (Events::IsMouseEvent(type)) { // "mouseDelta" state.PushLuaObject(mouseDelta); @@ -272,10 +287,37 @@ void InputEvent::CastToTable(LuaBind::State& state) const lua_setfield(state, table, "clickCount"); } - if (isKey) + if (Events::IsKeyEvent(type)) { } state.SetTop(table); +} + +void InputEvent::RestoreFromTable(LuaBind::State& state, int idx) +{ + int top = state.GetTop(); + int index = state.AbsIndex(idx); + type = (EInputEventType) state.GetField<int>(index, "type", InputEvent_Ignore); + use = state.GetField<bool>(index, "use", false); + + lua_getfield(state, index, "mousePosition"); + mousePosition.RestoreFromLuaObject(state, -1); + + if (Events::IsMouseEvent(type)) + { + lua_getfield(state, index, "mouseDelta"); + mouseDelta.RestoreFromLuaObject(state, -1); + + button = state.GetField<int>(index, "button", 0); + clickCount = state.GetField<int>(index, "clickCount", 0); + } + + if (Events::IsKeyEvent(type)) + { + + } + + state.SetTop(top); }
\ No newline at end of file diff --git a/Runtime/Events/InputEvent.h b/Runtime/Events/InputEvent.h index 164bfff..d19fbea 100644 --- a/Runtime/Events/InputEvent.h +++ b/Runtime/Events/InputEvent.h @@ -41,9 +41,9 @@ enum EModifiers { }; enum EMouseButton { - Mouse_LeftButton = 0, - Mouse_RightButton = 1, - Mouse_MiddleButton = 2 + Mouse_LeftButton = 1, + Mouse_RightButton = 2, + Mouse_MiddleButton = 3 }; // ¼ @@ -66,11 +66,16 @@ struct InputEvent : public LuaBind::INativeTable bool use; + InputEvent(); InputEvent(UINT message, WPARAM wParam, LPARAM lParam, HWND window); void CastToTable(LuaBind::State& state) const override; + void RestoreFromTable(LuaBind::State& state, int index) override; -private: - bool isMouse, isKey; +}; -};
\ No newline at end of file +namespace Events +{
+ bool IsMouseEvent(EInputEventType type); + bool IsKeyEvent(EInputEventType type); +}
\ No newline at end of file diff --git a/Runtime/Lua/LuaBind/LuaBindLClass.h b/Runtime/Lua/LuaBind/LuaBindLClass.h index 9f4c959..296d6a1 100644 --- a/Runtime/Lua/LuaBind/LuaBindLClass.h +++ b/Runtime/Lua/LuaBind/LuaBindLClass.h @@ -10,6 +10,7 @@ namespace LuaBind {
public:
virtual void CastToLuaObject(State&) const = 0 ;
+ virtual void RestoreFromLuaObject(State& state, int index) = 0;
};
diff --git a/Runtime/Lua/LuaBind/LuaBindTable.h b/Runtime/Lua/LuaBind/LuaBindTable.h index a3822d3..b3028f8 100644 --- a/Runtime/Lua/LuaBind/LuaBindTable.h +++ b/Runtime/Lua/LuaBind/LuaBindTable.h @@ -10,6 +10,7 @@ namespace LuaBind { // ṹתΪtableջ virtual void CastToTable(State& state) const = 0; + virtual void RestoreFromTable(State& state, int index) = 0; }; }
\ No newline at end of file diff --git a/Runtime/Math/Vector2.h b/Runtime/Math/Vector2.h index 31098ab..aba4262 100644 --- a/Runtime/Math/Vector2.h +++ b/Runtime/Math/Vector2.h @@ -68,6 +68,12 @@ namespace Internal } } + void RestoreFromLuaObject(LuaBind::State& state, int index) override + { + + } + + T x, y; static Vector2T<T> zero; diff --git a/Runtime/Scripting/Events/Events.bind.cpp b/Runtime/Scripting/Events/Events.bind.cpp new file mode 100644 index 0000000..40ea544 --- /dev/null +++ b/Runtime/Scripting/Events/Events.bind.cpp @@ -0,0 +1,65 @@ +#include "Runtime/Events/InputEvent.h"
+#include "Runtime/Lua/LuaHelper.h" +#include "Runtime/Debug/Log.h"
+
+// Events.CopyEvent(e)
+int CopyEvent(lua_State* L)
+{
+ LUA_BIND_STATE(L);
+
+ InputEvent e;
+ e.RestoreFromTable(state, -1);
+ state.PushTable(e);
+
+ return 1;
+}
+ +static luaL_Reg funcs[] = { + {"CopyEvent", CopyEvent}, + {0, 0} +};
+
+int luaopen_GameLab_Events(lua_State* L)
+{
+ log_info_tag("Scripting", "luaopen_GameLab_Events()"); + + LUA_BIND_STATE(L); + state.PushGlobalNamespace(); + state.PushNamespace("GameLab"); + state.PushNamespace("Events"); + + state.RegisterMethods(funcs); + + LUA_BIND_REGISTER_ENUM(state, "EEventType", + { "MouseDown", InputEvent_MouseDown },
+ { "MouseUp", InputEvent_MouseUp },
+ { "MouseMove", InputEvent_MouseMove },
+ { "MouseDrag", InputEvent_MouseDrag },
+ { "KeyDown", InputEvent_KeyDown },
+ { "KeyUp", InputEvent_KeyUp },
+ { "ScrollWheel", InputEvent_ScrollWheel },
+ { "Repaint", InputEvent_Repaint },
+ { "Layout", InputEvent_Layout },
+ { "DragUpdated", InputEvent_DragUpdated },
+ { "DragPerform", InputEvent_DragPerform },
+ { "DragExited", InputEvent_DragExited },
+ { "Ignore", InputEvent_Ignore },
+ { "Used", InputEvent_Used },
+ { "ValidateCommand", InputEvent_ValidateCommand },
+ { "ExecuteCommand", InputEvent_ExecuteCommand },
+ { "ContextClick", InputEvent_ContextClick },
+ { "MouseEnterWindow", InputEvent_MouseEnterWindow },
+ { "MouseLeaveWindow", InputEvent_MouseLeaveWindow },
+ { "MagnifyGesture", InputEvent_MagnifyGesture },
+ { "SwipeGesture", InputEvent_SwipeGesture },
+ { "RotateGesture", InputEvent_RotateGesture } + ); + + LUA_BIND_REGISTER_ENUM(state, "EMouseButton", + { "LeftButton", Mouse_LeftButton }, + { "RightButton", Mouse_RightButton }, + { "MiddleButton", Mouse_MiddleButton } + ); +
+ return 1; +}
\ No newline at end of file |