Skip to content

Commit

Permalink
Set SDL_HINT_MOUSE_TOUCH_EVENTS for iPhone and iPad as well
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 5, 2019
1 parent b6f33a6 commit 9eac91d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions include/SDL_hints.h
Expand Up @@ -319,11 +319,8 @@ extern "C" {
* \brief A variable controlling whether mouse events should generate synthetic touch events
*
* This variable can be set to the following values:
* "0" - Mouse events will not generate touch events
* "1" - Mouse events will generate touch events
*
* By default SDL will *not* generate touch events for mouse events
* Except for Android, they are generated by default.
* "0" - Mouse events will not generate touch events (default for desktop platforms)
* "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
*/

#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_mouse.c
Expand Up @@ -114,7 +114,7 @@ SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldVal

if (hint == NULL || *hint == '\0') {
/* Default */
#if defined(__ANDROID__)
#if defined(__ANDROID__) || (defined(__IPHONEOS__) && !defined(__TVOS__))
mouse->mouse_touch_events = SDL_TRUE;
#else
mouse->mouse_touch_events = SDL_FALSE;
Expand Down

0 comments on commit 9eac91d

Please sign in to comment.