summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-08 11:32:32 +0800
committerchai <chaifix@163.com>2021-11-08 11:32:32 +0800
commit13f477664c07826c92eac774f0035994c460c057 (patch)
tree4ca19d4e1520f9c5c24ae826331e096610b72e7c
parent827cbe8f0e846f65593d658ce5e2139259c97928 (diff)
*misc
-rw-r--r--Documents/输入.xlsxbin0 -> 10208 bytes
-rw-r--r--Editor/GUI/GUIWindow.cpp22
-rw-r--r--Projects/VisualStudio/Editor/Editor.vcxproj1
-rw-r--r--Projects/VisualStudio/Editor/Editor.vcxproj.filters3
-rw-r--r--Runtime/Events/InputEvent.cpp9
-rw-r--r--Runtime/Events/InputEvent.h3
-rw-r--r--Runtime/Events/KeyCode.h3
7 files changed, 28 insertions, 13 deletions
diff --git a/Documents/输入.xlsx b/Documents/输入.xlsx
new file mode 100644
index 0000000..2a4dafb
--- /dev/null
+++ b/Documents/输入.xlsx
Binary files differ
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp
index 16cf768..1a9ea00 100644
--- a/Editor/GUI/GUIWindow.cpp
+++ b/Editor/GUI/GUIWindow.cpp
@@ -29,10 +29,8 @@ static bool RedirectMouseWheel(HWND window, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
-//#if GAMELAB_DEBUG
-// static int _event_count = 0;
-// log_info_tag("WndProc", "GUIWindow Event %d", ++_event_count);
-//#endif
+ static int _event_count = 0;
+ ++_event_count;
GUIWindow* self = (GUIWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (!self)
@@ -51,7 +49,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
{
static PAINTSTRUCT ps;
- log_info_tag("WndProc", "WM_PAINT");
+ log_info_tag("WndProc", "WM_PAINT %d", _event_count);
self->SetAsRenderContext();
self->OnPaint();
@@ -64,7 +62,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_MOUSEWHEEL: // ÔÚÕâ¸ö×Ó´°¿Ú¹ö¶¯
{
- log_info_tag("WndProc","WM_MOUSEWHEEL");
+ log_info_tag("WndProc","WM_MOUSEWHEEL %d", _event_count);
// quick check if mouse is in our window
RECT rc;
@@ -105,7 +103,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_CHAR:
case WM_MOUSEMOVE:
{
- log_info_tag("WndProc", "Mouse Or Key Events");
+ log_info_tag("WndProc", "Mouse Or Key Events %d", _event_count);
switch (message)
{
@@ -153,7 +151,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_WINDOWPOSCHANGED:
{
- log_info_tag("WndProc", "WM_WINDOWPOSCHANGED");
+ log_info_tag("WndProc", "WM_WINDOWPOSCHANGED %d", _event_count);
// Çл»opengläÖȾĿ±ê£¬ÖØ»æÓû§Çø
//if (self->m_GfxWindow)
@@ -177,12 +175,12 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
}
case WM_SETFOCUS: //»ñµÃ½¹µã
- log_info_tag("WndProc", "WM_SETFOCUS");
+ log_info_tag("WndProc", "WM_SETFOCUS %d", _event_count);
self->OnFocus();
return 0;
case WM_KILLFOCUS: //ʧȥ½¹µã
- log_info_tag("WndProc", "WM_KILLFOCUS");
+ log_info_tag("WndProc", "WM_KILLFOCUS %d", _event_count);
return 0;
@@ -190,12 +188,12 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
break;
case WM_CLOSE:
- log_info_tag("WndProc", "WM_CLOSE");
+ log_info_tag("WndProc", "WM_CLOSE %d", _event_count);
delete self;
return 0;
case WM_INITMENUPOPUP: //ÏÂÀ­²Ëµ¥»ò×Ӳ˵¥½«Òª±»¼¤»îµÄʱºò
- log_info_tag("WndProc", "WM_INITMENUPOPUP");
+ log_info_tag("WndProc", "WM_INITMENUPOPUP %d", _event_count);
return 0;
}
diff --git a/Projects/VisualStudio/Editor/Editor.vcxproj b/Projects/VisualStudio/Editor/Editor.vcxproj
index 5231a28..3ebe2b5 100644
--- a/Projects/VisualStudio/Editor/Editor.vcxproj
+++ b/Projects/VisualStudio/Editor/Editor.vcxproj
@@ -267,6 +267,7 @@
<ClInclude Include="..\..\..\Runtime\Common\DataBuffer.h" />
<ClInclude Include="..\..\..\Runtime\Debug\Log.h" />
<ClInclude Include="..\..\..\Runtime\Events\InputEvent.h" />
+ <ClInclude Include="..\..\..\Runtime\Events\KeyCode.h" />
<ClInclude Include="..\..\..\Runtime\FileSystem\File.h" />
<ClInclude Include="..\..\..\Runtime\FileSystem\FileJobs.h" />
<ClInclude Include="..\..\..\Runtime\FileSystem\ImageJobs.h" />
diff --git a/Projects/VisualStudio/Editor/Editor.vcxproj.filters b/Projects/VisualStudio/Editor/Editor.vcxproj.filters
index d4fb6b7..f868707 100644
--- a/Projects/VisualStudio/Editor/Editor.vcxproj.filters
+++ b/Projects/VisualStudio/Editor/Editor.vcxproj.filters
@@ -744,6 +744,9 @@
<ClInclude Include="..\..\..\Editor\GUI\WindowBase.h">
<Filter>Editor\GUI</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\Runtime\Events\KeyCode.h">
+ <Filter>Runtime\Events</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\Runtime\Lua\LuaBind\LuaBindClass.inc">
diff --git a/Runtime/Events/InputEvent.cpp b/Runtime/Events/InputEvent.cpp
index ac41c94..e062bc2 100644
--- a/Runtime/Events/InputEvent.cpp
+++ b/Runtime/Events/InputEvent.cpp
@@ -1,12 +1,19 @@
#include "InputEvent.h"
+InputEvent::InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+
+}
+
void InputEvent::CastToTable(LuaBind::State& state)
{
lua_newtable(state);
int table = state.GetTop();
+ // "type"
lua_pushnumber(state, type);
lua_setfield(state, table, "type");
+ // "mousePosition"
-}
+} \ No newline at end of file
diff --git a/Runtime/Events/InputEvent.h b/Runtime/Events/InputEvent.h
index 5a5ed36..6069c85 100644
--- a/Runtime/Events/InputEvent.h
+++ b/Runtime/Events/InputEvent.h
@@ -1,5 +1,6 @@
#pragma once
+#include <windows.h>
#include "Runtime/Lua/LuaHelper.h"
#include "Runtime/Math/Math.h"
@@ -49,6 +50,8 @@ struct InputEvent : public LuaBind::INativeTable
bool use;
+ InputEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+
void CastToTable(LuaBind::State& state) override;
}; \ No newline at end of file
diff --git a/Runtime/Events/KeyCode.h b/Runtime/Events/KeyCode.h
new file mode 100644
index 0000000..96786d7
--- /dev/null
+++ b/Runtime/Events/KeyCode.h
@@ -0,0 +1,3 @@
+#pragma once
+
+