Set SDL_HINT_MOUSE_TOUCH_EVENTS for iPhone and iPad as well
authorSam Lantinga <slouken@libsdl.org>
Fri, 05 Apr 2019 08:10:12 -0700
changeset 126950c4d04572622
parent 12694 c9410703cbdd
child 12696 3ef8a628853d
Set SDL_HINT_MOUSE_TOUCH_EVENTS for iPhone and iPad as well
include/SDL_hints.h
src/events/SDL_mouse.c
     1.1 --- a/include/SDL_hints.h	Fri Apr 05 07:51:11 2019 -0700
     1.2 +++ b/include/SDL_hints.h	Fri Apr 05 08:10:12 2019 -0700
     1.3 @@ -319,11 +319,8 @@
     1.4   *  \brief  A variable controlling whether mouse events should generate synthetic touch events
     1.5   *
     1.6   *  This variable can be set to the following values:
     1.7 - *    "0"       - Mouse events will not generate touch events
     1.8 - *    "1"       - Mouse events will generate touch events
     1.9 - *
    1.10 - *  By default SDL will *not* generate touch events for mouse events
    1.11 - *  Except for Android, they are generated by default.
    1.12 + *    "0"       - Mouse events will not generate touch events (default for desktop platforms)
    1.13 + *    "1"       - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
    1.14   */
    1.15  
    1.16  #define SDL_HINT_MOUSE_TOUCH_EVENTS    "SDL_MOUSE_TOUCH_EVENTS"
     2.1 --- a/src/events/SDL_mouse.c	Fri Apr 05 07:51:11 2019 -0700
     2.2 +++ b/src/events/SDL_mouse.c	Fri Apr 05 08:10:12 2019 -0700
     2.3 @@ -114,7 +114,7 @@
     2.4  
     2.5      if (hint == NULL || *hint == '\0') {
     2.6          /* Default */
     2.7 -#if defined(__ANDROID__)
     2.8 +#if defined(__ANDROID__) || (defined(__IPHONEOS__) && !defined(__TVOS__))
     2.9          mouse->mouse_touch_events = SDL_TRUE;
    2.10  #else
    2.11          mouse->mouse_touch_events = SDL_FALSE;