mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-19 11:49:09 +00:00
Track mouse ups/downs for releasing purposes
This commit is contained in:
@ -432,7 +432,7 @@ void DebugMsgF(const char* format, ...);
|
|||||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static bool gDragging = false;
|
static bool gDragging = false;
|
||||||
static UInt32 keyState=0;
|
static UInt8 mouse_down = 0;
|
||||||
|
|
||||||
// Handle messages
|
// Handle messages
|
||||||
switch (message) {
|
switch (message) {
|
||||||
@ -442,8 +442,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_MBUTTONDBLCLK:
|
case WM_MBUTTONDBLCLK:
|
||||||
case WM_MBUTTONDOWN:
|
case WM_MBUTTONDOWN:
|
||||||
case WM_RBUTTONDBLCLK:
|
case WM_RBUTTONDBLCLK:
|
||||||
// Ensure we don't leave the client area during this action
|
// Ensure we don't leave the client area during clicks
|
||||||
SetCapture(hWnd);
|
if (!(mouse_down++))
|
||||||
|
SetCapture(hWnd);
|
||||||
// fall through to old case
|
// fall through to old case
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
// If they did anything but move the mouse, quit any intro movie playing.
|
// If they did anything but move the mouse, quit any intro movie playing.
|
||||||
@ -460,7 +461,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
case WM_RBUTTONUP:
|
case WM_RBUTTONUP:
|
||||||
case WM_MBUTTONUP:
|
case WM_MBUTTONUP:
|
||||||
// Stop hogging the cursor
|
// Stop hogging the cursor
|
||||||
ReleaseCapture();
|
if (!(--mouse_down))
|
||||||
|
ReleaseCapture();
|
||||||
// fall through to input processing
|
// fall through to input processing
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
case WM_KEYUP:
|
case WM_KEYUP:
|
||||||
|
Reference in New Issue
Block a user