Skip to content

Commit

Permalink
iOS interfering with Mac: Mac touchpad generates touch events too.
Browse files Browse the repository at this point in the history
Ignore them until Macs have a touchscreen: https://forums.libsdl.org/viewtopic.php?p=45758
  • Loading branch information
singalen authored and jyrkive committed Oct 28, 2018
1 parent fd2469b commit 559a9cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/core/event/handler.cpp
Expand Up @@ -380,8 +380,9 @@ void sdl_event_handler::handle_event(const SDL_Event& event)
}

Uint8 button = event.button.button;
#if defined(__IPHONEOS__) || !defined(__APPLE__)
CVideo& video = dynamic_cast<window&>(*dispatchers_.back()).video();

#endif
switch(event.type) {
case SDL_MOUSEMOTION:
#ifdef MOUSE_TOUCH_EMULATION
Expand Down Expand Up @@ -477,6 +478,7 @@ void sdl_event_handler::handle_event(const SDL_Event& event)
text_editing(event.edit.text, event.edit.start, event.edit.length);
break;

#if defined(__IPHONEOS__) || !defined(__APPLE__)
case SDL_FINGERMOTION:
{
SDL_Rect r = video.screen_area();
Expand Down Expand Up @@ -506,6 +508,7 @@ void sdl_event_handler::handle_event(const SDL_Event& event)
event.mgesture.dTheta, event.mgesture.dDist, event.mgesture.numFingers);
}
break;
#endif

#if(defined(_X11) && !defined(__APPLE__)) || defined(_WIN32)
case SDL_SYSWMEVENT:
Expand Down

0 comments on commit 559a9cc

Please sign in to comment.