Browse Source

input: fixed crash when user rotate the mouse wheel

undefined
Benlitz Sam Hocevar <sam@hocevar.net> 11 years ago
parent
commit
e1a4367226
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/platform/sdl/sdlinput.cpp

+ 3
- 1
src/platform/sdl/sdlinput.cpp View File

@@ -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;
}



Loading…
Cancel
Save