src/video/android/SDL_androidtouch.c
changeset 9481 dfe2be947ca3
parent 9480 7b10bc6b6246
child 9619 b94b6d0bff0f
equal deleted inserted replaced
9480:7b10bc6b6246 9481:dfe2be947ca3
   106 
   106 
   107     fingerId = (SDL_FingerID)pointer_finger_id_in;
   107     fingerId = (SDL_FingerID)pointer_finger_id_in;
   108     switch (action) {
   108     switch (action) {
   109         case ACTION_DOWN:
   109         case ACTION_DOWN:
   110             /* Primary pointer down */
   110             /* Primary pointer down */
   111             Android_GetWindowCoordinates(x, y, &window_x, &window_y);
       
   112             if (!separate_mouse_and_touch) {
   111             if (!separate_mouse_and_touch) {
       
   112                 Android_GetWindowCoordinates(x, y, &window_x, &window_y);
   113                 /* send moved event */
   113                 /* send moved event */
   114                 SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
   114                 SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
   115                 /* send mouse down event */
   115                 /* send mouse down event */
   116                 SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   116                 SDL_SendMouseButton(Android_Window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   117             }
   117             }
   121             SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
   121             SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
   122             break;
   122             break;
   123 
   123 
   124         case ACTION_MOVE:
   124         case ACTION_MOVE:
   125             if (!pointerFingerID) {
   125             if (!pointerFingerID) {
   126                 Android_GetWindowCoordinates(x, y, &window_x, &window_y);
       
   127                 if (!separate_mouse_and_touch) {
   126                 if (!separate_mouse_and_touch) {
       
   127                     Android_GetWindowCoordinates(x, y, &window_x, &window_y);
   128                     /* send moved event */
   128                     /* send moved event */
   129                     SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
   129                     SDL_SendMouseMotion(Android_Window, SDL_TOUCH_MOUSEID, 0, window_x, window_y);
   130                 }
   130                 }
   131             }
   131             }
   132             SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p);
   132             SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p);