win32: added mouse wheel support

This commit is contained in:
Jay Sorg 2012-10-16 09:57:12 -07:00
parent 702f8498e5
commit c6ecaf4442

View File

@ -119,6 +119,27 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
static int xf_event_process_WM_MOUSEWHEEL(wfInfo* wfi, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, boolean app)
{
int delta;
int flags;
rdpInput* input;
DefWindowProc(hWnd, Msg, wParam, lParam);
input = wfi->instance->input;
delta = ((signed short)HIWORD(wParam)); /* GET_WHEEL_DELTA_WPARAM(wParam); */
if (delta > 0)
{
flags = PTR_FLAGS_WHEEL | 0x0078;
}
else
{
flags = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
}
input->MouseEvent(input, flags, 0, 0);
return 0;
}
LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
@ -173,6 +194,10 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
case WM_MOUSEMOVE:
input->MouseEvent(input, PTR_FLAGS_MOVE, X_POS(lParam), Y_POS(lParam));
break;
case WM_MOUSEWHEEL:
xf_event_process_WM_MOUSEWHEEL(wfi, hWnd, Msg, wParam, lParam, FALSE);
break;
case WM_SETCURSOR:
SetCursor(wfi->cursor);