From e1a436722638274860ba5ddd783314511332afed Mon Sep 17 00:00:00 2001 From: Benlitz Date: Tue, 1 Oct 2013 15:36:33 +0000 Subject: [PATCH] input: fixed crash when user rotate the mouse wheel --- src/platform/sdl/sdlinput.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/sdl/sdlinput.cpp b/src/platform/sdl/sdlinput.cpp index c2009fc3..0d82ed60 100644 --- a/src/platform/sdl/sdlinput.cpp +++ b/src/platform/sdl/sdlinput.cpp @@ -194,7 +194,9 @@ void SdlInputData::Tick(float seconds) case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: { - m_mouse->SetKey(event.button.button - 1, event.type == SDL_MOUSEBUTTONDOWN); + if (event.button.button != SDL_BUTTON_WHEELUP && event.button.button != SDL_BUTTON_WHEELDOWN) + m_mouse->SetKey(event.button.button - 1, event.type == SDL_MOUSEBUTTONDOWN); + // TODO: mouse wheel as axis break; }