src/video/uikit/SDL_uikitview.m
changeset 6950 1ddb72193079
parent 6885 700f1b25f77f
child 6951 7833f01322b3
equal deleted inserted replaced
6949:4de584a3a027 6950:1ddb72193079
   102     while (touch) {
   102     while (touch) {
   103         if (!leftFingerDown) {
   103         if (!leftFingerDown) {
   104             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   104             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   105 
   105 
   106             /* send moved event */
   106             /* send moved event */
   107             SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
   107             SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   108 
   108 
   109             /* send mouse down event */
   109             /* send mouse down event */
   110             SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT);
   110             SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
   111 
   111 
   112             leftFingerDown = (SDL_FingerID)touch;
   112             leftFingerDown = (SDL_FingerID)touch;
   113         }
   113         }
   114 
   114 
   115         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   115         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   142     UITouch *touch = (UITouch*)[enumerator nextObject];
   142     UITouch *touch = (UITouch*)[enumerator nextObject];
   143 
   143 
   144     while(touch) {
   144     while(touch) {
   145         if ((SDL_FingerID)touch == leftFingerDown) {
   145         if ((SDL_FingerID)touch == leftFingerDown) {
   146             /* send mouse up */
   146             /* send mouse up */
   147             SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT);
   147             SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
   148             leftFingerDown = 0;
   148             leftFingerDown = 0;
   149         }
   149         }
   150 
   150 
   151         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   151         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   152 #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
   152 #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
   187     while (touch) {
   187     while (touch) {
   188         if ((SDL_FingerID)touch == leftFingerDown) {
   188         if ((SDL_FingerID)touch == leftFingerDown) {
   189             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   189             CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
   190 
   190 
   191             /* send moved event */
   191             /* send moved event */
   192             SDL_SendMouseMotion(NULL, 0, locationInView.x, locationInView.y);
   192             SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
   193         }
   193         }
   194 
   194 
   195         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   195         CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
   196 #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
   196 #ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
   197         SDL_SendTouchMotion(touchId, (long)touch,
   197         SDL_SendTouchMotion(touchId, (long)touch,