Browse Source

DiabloUI: Handle mouse wheel in SDL 1.2

pull/3743/head
Gleb Mazovetskiy 4 years ago
parent
commit
401d0ff33f
  1. 13
      Source/DiabloUI/diabloui.cpp

13
Source/DiabloUI/diabloui.cpp

@ -352,7 +352,7 @@ void UiFocusNavigation(SDL_Event *event)
if (HandleMenuAction(GetMenuAction(*event)))
return;
#ifndef USE_SDL1
#if SDL_VERSION_ATLEAST(2, 0, 0)
if (event->type == SDL_MOUSEWHEEL) {
if (event->wheel.y > 0) {
UiFocusUp();
@ -361,6 +361,17 @@ void UiFocusNavigation(SDL_Event *event)
}
return;
}
#else
if (event->type == SDL_MOUSEBUTTONDOWN) {
switch (event->button.button) {
case SDL_BUTTON_WHEELUP:
UiFocusUp();
return;
case SDL_BUTTON_WHEELDOWN:
UiFocusDown();
return;
}
}
#endif
if (textInputActive) {

Loading…
Cancel
Save