diff options
author | Thierry Crozat | 2017-03-21 21:06:18 +0000 |
---|---|---|
committer | Thierry Crozat | 2017-03-21 21:06:35 +0000 |
commit | a20d2172fa721188fb8cb07766504e59b8985629 (patch) | |
tree | 53530983f01c418800e4345416586e7729959dbe /backends/events/sdl | |
parent | 80c22322cb16ed701433914b68f05f421fe08ac7 (diff) | |
download | scummvm-rg350-a20d2172fa721188fb8cb07766504e59b8985629.tar.gz scummvm-rg350-a20d2172fa721188fb8cb07766504e59b8985629.tar.bz2 scummvm-rg350-a20d2172fa721188fb8cb07766504e59b8985629.zip |
SDL: Respect OS setting for wheel scroll direction on SDL 2.0.4+
The setting was already respected on SDL < 2.0.4 (such as SDL1).
If the OS inverts the scrolling direction, this is reflected on the sign
of the y value of the SDL event. Since version 2.0.4 the SDL event
also had a flag to indicate if the direction is flipped and we were
using it to change back the y sign. That means the OS scrolling
direction setting was not respected. With this commit we now have
a consistent behaviour with all SDL versions (the OS scroll direction
setting is respected).
If our wheel events are used for something other than scrolling
however, we might want to get the actually wheel move direction
(i.e. use a Common::EVENT_WHEELDOWN when moving the wheel
down even if the OS scroll setting is to flip it). In such a case we
might want to revert this change and instead add an additional flag
to the event so that we know the scroll direction should be flipped
and use it in places where the event is used for scrolling.
Diffstat (limited to 'backends/events/sdl')
-rw-r--r-- | backends/events/sdl/sdl-events.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index a1657468a8..946a1af23f 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -545,11 +545,6 @@ bool SdlEventSource::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) { #if SDL_VERSION_ATLEAST(2, 0, 0) case SDL_MOUSEWHEEL: { Sint32 yDir = ev.wheel.y; -#if SDL_VERSION_ATLEAST(2, 0, 4) - if (ev.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) { - yDir *= -1; - } -#endif // HACK: It seems we want the mouse coordinates supplied // with a mouse wheel event. However, SDL2 does not supply // these, thus we use whatever we got last time. It seems |