mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fixed mouse drag with an external mouse on iOS
This commit is contained in:
parent
d0947c1483
commit
3ac24bfc1a
@ -73,6 +73,9 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
|||||||
UIPanGestureRecognizer *mouseWheelRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(mouseWheelGesture:)];
|
UIPanGestureRecognizer *mouseWheelRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(mouseWheelGesture:)];
|
||||||
mouseWheelRecognizer.allowedScrollTypesMask = UIScrollTypeMaskDiscrete;
|
mouseWheelRecognizer.allowedScrollTypesMask = UIScrollTypeMaskDiscrete;
|
||||||
mouseWheelRecognizer.allowedTouchTypes = @[ @(UITouchTypeIndirectPointer) ];
|
mouseWheelRecognizer.allowedTouchTypes = @[ @(UITouchTypeIndirectPointer) ];
|
||||||
|
mouseWheelRecognizer.cancelsTouchesInView = NO;
|
||||||
|
mouseWheelRecognizer.delaysTouchesBegan = NO;
|
||||||
|
mouseWheelRecognizer.delaysTouchesEnded = NO;
|
||||||
[self addGestureRecognizer:mouseWheelRecognizer];
|
[self addGestureRecognizer:mouseWheelRecognizer];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -370,10 +373,10 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
|
|||||||
{
|
{
|
||||||
#ifdef __IPHONE_13_4
|
#ifdef __IPHONE_13_4
|
||||||
if ([press respondsToSelector:@selector((key))]) {
|
if ([press respondsToSelector:@selector((key))]) {
|
||||||
if (press.key != nil) {
|
if (press.key != nil) {
|
||||||
return (SDL_Scancode)press.key.keyCode;
|
return (SDL_Scancode)press.key.keyCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SDL_JOYSTICK_DISABLED
|
#if !SDL_JOYSTICK_DISABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user