Bug 4576: remove touch/mouse duplication for IOS
authorSylvain Becker <sylvain.becker@gmail.com>
Tue, 02 Apr 2019 17:18:47 +0200
changeset 12682aec854f934db
parent 12681 450b42f2f24c
child 12683 0dd4bae437a5
Bug 4576: remove touch/mouse duplication for IOS
src/video/uikit/SDL_uikitview.m
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Apr 02 17:13:22 2019 +0200
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Apr 02 17:18:47 2019 +0200
     1.3 @@ -41,8 +41,6 @@
     1.4  
     1.5      SDL_TouchID directTouchId;
     1.6      SDL_TouchID indirectTouchId;
     1.7 -
     1.8 -    UITouch * __weak firstFingerDown;
     1.9  }
    1.10  
    1.11  - (instancetype)initWithFrame:(CGRect)frame
    1.12 @@ -218,18 +216,7 @@
    1.13              continue;
    1.14          }
    1.15  
    1.16 -        if (!firstFingerDown) {
    1.17 -            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
    1.18 -            int clicks = (int) touch.tapCount;
    1.19 -
    1.20 -            /* send mouse moved event */
    1.21 -            SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
    1.22 -
    1.23 -            /* send mouse down event */
    1.24 -            SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT, clicks);
    1.25 -
    1.26 -            firstFingerDown = touch;
    1.27 -        }
    1.28 +        /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
    1.29  
    1.30          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    1.31          SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
    1.32 @@ -248,12 +235,7 @@
    1.33              continue;
    1.34          }
    1.35  
    1.36 -        if (touch == firstFingerDown) {
    1.37 -            /* send mouse up */
    1.38 -            int clicks = (int) touch.tapCount;
    1.39 -            SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT, clicks);
    1.40 -            firstFingerDown = nil;
    1.41 -        }
    1.42 +        /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
    1.43  
    1.44          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    1.45          SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
    1.46 @@ -277,13 +259,6 @@
    1.47              continue;
    1.48          }
    1.49  
    1.50 -        if (touch == firstFingerDown) {
    1.51 -            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
    1.52 -
    1.53 -            /* send moved event */
    1.54 -            SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
    1.55 -        }
    1.56 -
    1.57          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    1.58          SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
    1.59                              locationInView.x, locationInView.y, pressure);