diff options
Diffstat (limited to 'src/extern/wog.c')
-rw-r--r-- | src/extern/wog.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/extern/wog.c b/src/extern/wog.c index 6cdfb6f..28d4dd1 100644 --- a/src/extern/wog.c +++ b/src/extern/wog.c @@ -131,6 +131,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_LBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -139,6 +141,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_RBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -147,6 +151,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONDOWN; e->button = WOG_MOUSE_MIDDLE; + wog_getMouse(window, &e->pos.x, &e->pos.y); + SetCapture(hWnd); return ; } @@ -155,6 +161,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_LBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -163,6 +171,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_RBUTTON; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -171,6 +181,8 @@ void wog_handleEvent(wog_Window* window, MSG* msg, wog_Event* e) zero_mem(e, sizeof(wog_Event)); e->type = WOG_EMOUSEBUTTONUP; e->button = WOG_MOUSE_MIDDLE; + wog_getMouse(window, &e->pos.x, &e->pos.y); + ReleaseCapture(); return ; } @@ -626,8 +638,10 @@ void wog_getMouse(wog_Window* wnd, int *x, int *y) ScreenToClient(wnd->hwnd, &p); int w, h; wog_getwindowsize(wnd, &w, &h); - *x = clamp(p.x, 0, w); - *y = clamp(p.y, 0, h); + //*x = clamp(p.x, 0, w); + //*y = clamp(p.y, 0, h); + *x = p.x; + *y = p.y; } |