- Fixed: The mouse wheel generated no events in GUI mode if you weren't

fullscreen. (e.g. You could no longer scroll the console with the mouse
  buffer.)
- Fixed: Wheeling down was seen as wheeling up with the Win32 mouse.


SVN r1618 (trunk)
This commit is contained in:
Randy Heit 2009-05-27 22:57:21 +00:00
commit 092512c44a
4 changed files with 63 additions and 35 deletions

View file

@ -143,6 +143,7 @@ extern menu_t JoystickMenu;
EXTERN_CVAR (String, language)
EXTERN_CVAR (Bool, lookstrafe)
static int WheelDelta;
extern BOOL paused;
static bool noidle = false;
@ -415,6 +416,32 @@ bool GUIWndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESU
}
D_PostEvent(&ev);
return true;
// Note: If the mouse is grabbed, it sends the mouse wheel events itself.
case WM_MOUSEWHEEL:
if (wParam & MK_SHIFT) ev.data3 |= GKM_SHIFT;
if (wParam & MK_CONTROL) ev.data3 |= GKM_CTRL;
if (GetKeyState(VK_MENU) & 0x8000) ev.data3 |= GKM_ALT;
WheelDelta += (SHORT)HIWORD(wParam);
if (WheelDelta < 0)
{
ev.subtype = EV_GUI_WheelDown;
while (WheelDelta <= -WHEEL_DELTA)
{
D_PostEvent(&ev);
WheelDelta += WHEEL_DELTA;
}
}
else
{
ev.subtype = EV_GUI_WheelUp;
while (WheelDelta >= WHEEL_DELTA)
{
D_PostEvent(&ev);
WheelDelta -= WHEEL_DELTA;
}
}
return true;
}
return false;
}