diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 7e43c7ab2e..93a1288f94 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -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) diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 8af1a0dad8..c7947b1a69 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -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; }