src/video/uikit/SDL_uikitview.m
changeset 10366 e1b52e69578b
parent 10340 5724f5087acd
child 10710 a6babd973955
equal deleted inserted replaced
10365:7f3be5258f80 10366:e1b52e69578b
   141     for (UITouch *touch in touches) {
   141     for (UITouch *touch in touches) {
   142         float pressure = [self pressureForTouch:touch];
   142         float pressure = [self pressureForTouch:touch];
   143 
   143 
   144         if (!firstFingerDown) {
   144         if (!firstFingerDown) {
   145             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   145             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
       
   146             int clicks = (int) touch.tapCount;
   146 
   147 
   147             /* send mouse moved event */
   148             /* send mouse moved event */
   148             SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   149             SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   149 
   150 
   150             /* send mouse down event */
   151             /* send mouse down event */
   151             SDL_SendMouseButton(sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   152             SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT, clicks);
   152 
   153 
   153             firstFingerDown = touch;
   154             firstFingerDown = touch;
   154         }
   155         }
   155 
   156 
   156         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   157         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   164     for (UITouch *touch in touches) {
   165     for (UITouch *touch in touches) {
   165         float pressure = [self pressureForTouch:touch];
   166         float pressure = [self pressureForTouch:touch];
   166 
   167 
   167         if (touch == firstFingerDown) {
   168         if (touch == firstFingerDown) {
   168             /* send mouse up */
   169             /* send mouse up */
   169             SDL_SendMouseButton(sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
   170             int clicks = (int) touch.tapCount;
       
   171             SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT, clicks);
   170             firstFingerDown = nil;
   172             firstFingerDown = nil;
   171         }
   173         }
   172 
   174 
   173         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   175         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   174         SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
   176         SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),