Skip to content

Commit

Permalink
Merge pull request #91 from mannyamorim/mouse-pos-scroll-event
Browse files Browse the repository at this point in the history
WINCON: Send real mouse position with scroll event
  • Loading branch information
wmcbrine authored May 27, 2023
2 parents f62cfb9 + 692a7bb commit 5596bd7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions wincon/pdckbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,16 +480,16 @@ static int _process_mouse_event(void)

memset(&SP->mouse_status, 0, sizeof(MOUSE_STATUS));

SP->mouse_status.x = MEV.dwMousePosition.X;
SP->mouse_status.y = MEV.dwMousePosition.Y;

/* Handle scroll wheel */

if (MEV.dwEventFlags == 4)
{
SP->mouse_status.changes = (MEV.dwButtonState & 0xFF000000) ?
PDC_MOUSE_WHEEL_DOWN : PDC_MOUSE_WHEEL_UP;

SP->mouse_status.x = -1;
SP->mouse_status.y = -1;

memset(&old_mouse_status, 0, sizeof(old_mouse_status));

return KEY_MOUSE;
Expand All @@ -500,9 +500,6 @@ static int _process_mouse_event(void)
SP->mouse_status.changes = (MEV.dwButtonState & 0xFF000000) ?
PDC_MOUSE_WHEEL_RIGHT : PDC_MOUSE_WHEEL_LEFT;

SP->mouse_status.x = -1;
SP->mouse_status.y = -1;

memset(&old_mouse_status, 0, sizeof(old_mouse_status));

return KEY_MOUSE;
Expand Down Expand Up @@ -551,9 +548,6 @@ static int _process_mouse_event(void)
}
}

SP->mouse_status.x = MEV.dwMousePosition.X;
SP->mouse_status.y = MEV.dwMousePosition.Y;

SP->mouse_status.changes = 0;

for (i = 0; i < 3; i++)
Expand Down

0 comments on commit 5596bd7

Please sign in to comment.