mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-02-25 09:56:47 +00:00
Bug 4576: remove touch/mouse duplication for IOS
This commit is contained in:
parent
42de5f97cc
commit
9d28156f12
|
@ -41,8 +41,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||||
|
|
||||||
SDL_TouchID directTouchId;
|
SDL_TouchID directTouchId;
|
||||||
SDL_TouchID indirectTouchId;
|
SDL_TouchID indirectTouchId;
|
||||||
|
|
||||||
UITouch * __weak firstFingerDown;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
|
@ -218,18 +216,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!firstFingerDown) {
|
/* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
|
||||||
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
|
|
||||||
int clicks = (int) touch.tapCount;
|
|
||||||
|
|
||||||
/* send mouse moved event */
|
|
||||||
SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
|
|
||||||
|
|
||||||
/* send mouse down event */
|
|
||||||
SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT, clicks);
|
|
||||||
|
|
||||||
firstFingerDown = touch;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
||||||
SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
|
SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
|
||||||
|
@ -248,12 +235,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (touch == firstFingerDown) {
|
/* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
|
||||||
/* send mouse up */
|
|
||||||
int clicks = (int) touch.tapCount;
|
|
||||||
SDL_SendMouseButtonClicks(sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT, clicks);
|
|
||||||
firstFingerDown = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
||||||
SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
|
SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
|
||||||
|
@ -277,13 +259,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (touch == firstFingerDown) {
|
|
||||||
CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
|
|
||||||
|
|
||||||
/* send moved event */
|
|
||||||
SDL_SendMouseMotion(sdlwindow, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
|
||||||
SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
|
SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
|
||||||
locationInView.x, locationInView.y, pressure);
|
locationInView.x, locationInView.y, pressure);
|
||||||
|
|
Loading…
Reference in a new issue