(Windows/Mouse) Wheel works now in normal mode - doesn't work in

grabbed mouse state (exclusive foreground mode)
This commit is contained in:
twinaphex 2015-03-10 23:40:54 +01:00
parent 1ae12d462c
commit 667a461c89
2 changed files with 18 additions and 5 deletions

View File

@ -266,7 +266,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
g_quit = true;
return 0;
}
case WM_SIZE:
/* Do not send resize message if we minimize. */
if (wparam != SIZE_MAXHIDE && wparam != SIZE_MINIMIZED)

View File

@ -201,8 +201,6 @@ static void dinput_poll(void *data)
di->mouse_l = mouse_state.rgbButtons[0];
di->mouse_r = mouse_state.rgbButtons[1];
di->mouse_m = mouse_state.rgbButtons[2];
di->mouse_wu = mouse_state.rgbButtons[3];
di->mouse_wd = mouse_state.rgbButtons[4];
/* No simple way to get absolute coordinates
* for RETRO_DEVICE_POINTER. Just use Win32 APIs. */
@ -306,9 +304,17 @@ static int16_t dinput_mouse_state(struct dinput_input *di, unsigned id)
case RETRO_DEVICE_ID_MOUSE_RIGHT:
return di->mouse_r;
case RETRO_DEVICE_ID_MOUSE_WHEELUP:
return di->mouse_wu;
{
int16_t state = di->mouse_wu;
di->mouse_wu = 0;
return state;
}
case RETRO_DEVICE_ID_MOUSE_WHEELDOWN:
return di->mouse_wd;
{
int16_t state = di->mouse_wd;
di->mouse_wd = 0;
return state;
}
case RETRO_DEVICE_ID_MOUSE_MIDDLE:
return di->mouse_m;
}
@ -545,6 +551,14 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa
di->joypad = input_joypad_init_driver(g_settings.input.joypad_driver);
break;
}
case WM_MOUSEWHEEL:
{
if (((short) HIWORD(wParam))/120 > 0)
di->mouse_wu = 1;
if (((short) HIWORD(wParam))/120 < 0)
di->mouse_wd = 1;
}
break;
}
return false;
}