Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed mouse drag with an external mouse on iOS
  • Loading branch information
slouken committed Jun 9, 2020
1 parent d0947c1 commit 3ac24bf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/video/uikit/SDL_uikitview.m
Expand Up @@ -73,6 +73,9 @@ - (instancetype)initWithFrame:(CGRect)frame
UIPanGestureRecognizer *mouseWheelRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(mouseWheelGesture:)];
mouseWheelRecognizer.allowedScrollTypesMask = UIScrollTypeMaskDiscrete;
mouseWheelRecognizer.allowedTouchTypes = @[ @(UITouchTypeIndirectPointer) ];
mouseWheelRecognizer.cancelsTouchesInView = NO;
mouseWheelRecognizer.delaysTouchesBegan = NO;
mouseWheelRecognizer.delaysTouchesEnded = NO;
[self addGestureRecognizer:mouseWheelRecognizer];
}
#endif
Expand Down Expand Up @@ -370,10 +373,10 @@ - (SDL_Scancode)scancodeFromPress:(UIPress*)press
{
#ifdef __IPHONE_13_4
if ([press respondsToSelector:@selector((key))]) {
if (press.key != nil) {
return (SDL_Scancode)press.key.keyCode;
}
}
if (press.key != nil) {
return (SDL_Scancode)press.key.keyCode;
}
}
#endif

#if !SDL_JOYSTICK_DISABLED
Expand Down

0 comments on commit 3ac24bf

Please sign in to comment.