mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Implemented proper mouse wheel event handling in the Windows debugger. [Curt Coder]
This commit is contained in:
parent
cc9ea396f7
commit
bfcb47e2da
@ -742,7 +742,17 @@ static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wpar
|
|||||||
// mouse wheel: forward to the first view
|
// mouse wheel: forward to the first view
|
||||||
case WM_MOUSEWHEEL:
|
case WM_MOUSEWHEEL:
|
||||||
{
|
{
|
||||||
int delta = (INT16)HIWORD(wparam) / WHEEL_DELTA;
|
static int units_carryover = 0;
|
||||||
|
|
||||||
|
UINT lines_per_click;
|
||||||
|
if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &lines_per_click, 0))
|
||||||
|
lines_per_click = 3;
|
||||||
|
|
||||||
|
int units = GET_WHEEL_DELTA_WPARAM(wparam) + units_carryover;
|
||||||
|
int clicks = units / WHEEL_DELTA;
|
||||||
|
units_carryover = units % WHEEL_DELTA;
|
||||||
|
|
||||||
|
int delta = clicks * lines_per_click;
|
||||||
int viewnum = 0;
|
int viewnum = 0;
|
||||||
POINT point;
|
POINT point;
|
||||||
HWND child;
|
HWND child;
|
||||||
@ -763,10 +773,10 @@ static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wpar
|
|||||||
// send the appropriate message to this view's scrollbar
|
// send the appropriate message to this view's scrollbar
|
||||||
if (info->view[viewnum].wnd && info->view[viewnum].vscroll)
|
if (info->view[viewnum].wnd && info->view[viewnum].vscroll)
|
||||||
{
|
{
|
||||||
int message_type = SB_LINELEFT;
|
int message_type = SB_LINEUP;
|
||||||
if (delta < 0)
|
if (delta < 0)
|
||||||
{
|
{
|
||||||
message_type = SB_LINERIGHT;
|
message_type = SB_LINEDOWN;
|
||||||
delta = -delta;
|
delta = -delta;
|
||||||
}
|
}
|
||||||
while (delta > 0)
|
while (delta > 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user