From fd0929d89c3cd0c8b9818d9f583000adf0b39711 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 27 Jun 2025 03:11:54 +0800 Subject: [PATCH] =?UTF-8?q?InputEvent=E6=94=B9=E5=90=8D=E4=B8=BAEventDispa?= =?UTF-8?q?tch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/platform/Window.h | 2 +- src/Win/WinMessage.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/hgl/platform/Window.h b/inc/hgl/platform/Window.h index 3621de7..f0ed89e 100644 --- a/inc/hgl/platform/Window.h +++ b/inc/hgl/platform/Window.h @@ -27,7 +27,7 @@ namespace hgl * 本事件传递器会呼叫io::WindowEvent的对象指针,在本类中指向的是自己。
* 注:仅当前类会如此设计,本身此Event是要放在外面的,不该在此级别。 */ - io::InputEvent input_event; + io::EventDispatch input_event; void OnResize(uint,uint) override; void OnActive(bool) override; diff --git a/src/Win/WinMessage.cpp b/src/Win/WinMessage.cpp index 393dba4..8ddd46a 100644 --- a/src/Win/WinMessage.cpp +++ b/src/Win/WinMessage.cpp @@ -17,7 +17,7 @@ namespace hgl #define PROP_DPIISOLATION L"PROP_ISOLATION" static KeyboardButton KeyConvert[256]; - static void (*WMProc[2048])(InputEvent *,uint32,uint32); //消息处理队列 + static void (*WMProc[2048])(EventDispatch *,uint32,uint32); //消息处理队列 void InitKeyConvert() { @@ -182,7 +182,7 @@ namespace hgl static EventHeader event_header; static WindowEventData window_event_data; - void WMProcDestroy(InputEvent *ie,uint32,uint32) + void WMProcDestroy(EventDispatch *ie,uint32,uint32) { event_header.type =InputEventSource::Window; event_header.index =0; @@ -194,7 +194,7 @@ namespace hgl static MouseEventData mouse_event_data; - #define WMEF_MOUSE(mouse_button,action) void WMProcMouse##mouse_button##action(InputEvent *ie,uint32 wParam,uint32 lParam) \ + #define WMEF_MOUSE(mouse_button,action) void WMProcMouse##mouse_button##action(EventDispatch *ie,uint32 wParam,uint32 lParam) \ { \ mouse_event_data.x=LOWORD(lParam); \ mouse_event_data.y=HIWORD(lParam); \ @@ -219,7 +219,7 @@ namespace hgl WMEF_MOUSE(Right,Released); WMEF_MOUSE(Right,DblClicked); - void WMProcMouseMove(InputEvent *ie,uint32 wParam,uint32 lParam) + void WMProcMouseMove(EventDispatch *ie,uint32 wParam,uint32 lParam) { mouse_event_data.x=LOWORD(lParam); mouse_event_data.y=HIWORD(lParam); @@ -233,7 +233,7 @@ namespace hgl } #undef WMEF_MOUSE - #define WMEF2(name) void name(InputEvent *ie,uint32 wParam,uint32 lParam) + #define WMEF2(name) void name(EventDispatch *ie,uint32 wParam,uint32 lParam) WMEF2(WMProcMouseWheel) { const int zDelta=GET_WHEEL_DELTA_WPARAM(wParam); @@ -281,7 +281,7 @@ namespace hgl static KeyboardEventData keyboard_event_data; - #define WMEF1(name) void name(InputEvent *ie,uint32 wParam,uint32) + #define WMEF1(name) void name(EventDispatch *ie,uint32 wParam,uint32) WMEF1(WMProcKeyDown) { event_header.type =InputEventSource::Keyboard; @@ -371,7 +371,7 @@ namespace hgl if(uMsg<2048) if(WMProc[uMsg]) { - InputEvent *ie=(InputEvent *)GetWindowLongPtrW(hWnd,GWLP_USERDATA); + EventDispatch *ie=(EventDispatch *)GetWindowLongPtrW(hWnd,GWLP_USERDATA); if(ie) WMProc[uMsg](ie,wParam,lParam);