src/events/SDL_mouse.c
changeset 12692 69f24f4ef99e
parent 12688 cc45bcb16ef2
child 12695 0c4d04572622
equal deleted inserted replaced
12691:3125dc339d8d 12692:69f24f4ef99e
   110 static void SDLCALL
   110 static void SDLCALL
   111 SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
   111 SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
   112 {
   112 {
   113     SDL_Mouse *mouse = (SDL_Mouse *)userdata;
   113     SDL_Mouse *mouse = (SDL_Mouse *)userdata;
   114 
   114 
   115     if (hint && (*hint == '1' || SDL_strcasecmp(hint, "true") == 0)) {
   115     if (hint == NULL || *hint == '\0') {
   116 
   116         /* Default */
       
   117 #if defined(__ANDROID__)
       
   118         mouse->mouse_touch_events = SDL_TRUE;
       
   119 #else
       
   120         mouse->mouse_touch_events = SDL_FALSE;
       
   121 #endif
       
   122     } else if (*hint == '1' || SDL_strcasecmp(hint, "true") == 0) {
       
   123         mouse->mouse_touch_events = SDL_TRUE;
       
   124     } else {
       
   125         mouse->mouse_touch_events = SDL_FALSE;
       
   126     }
       
   127 
       
   128     if (mouse->mouse_touch_events) {
   117         SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input");
   129         SDL_AddTouch(SDL_MOUSE_TOUCHID, SDL_TOUCH_DEVICE_DIRECT, "mouse_input");
   118 
       
   119         mouse->mouse_touch_events = SDL_TRUE;
       
   120     } else {
       
   121         mouse->mouse_touch_events = SDL_FALSE;
       
   122     }
   130     }
   123 }
   131 }
   124 
   132 
   125 /* Public functions */
   133 /* Public functions */
   126 int
   134 int