Skip to content

Commit

Permalink
Hide the mouse cursor appropriately on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 14, 2020
1 parent 9e3b259 commit 171ba00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/uikit/SDL_uikitview.h
Expand Up @@ -37,6 +37,7 @@

#if !TARGET_OS_TV && defined(__IPHONE_13_4)
- (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4));
- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4));
#endif

- (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize;
Expand Down
8 changes: 8 additions & 0 deletions src/video/uikit/SDL_uikitview.m
Expand Up @@ -155,6 +155,14 @@ - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regi
}
return [UIPointerRegion regionWithRect:self.bounds identifier:nil];
}

- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)){
if (SDL_ShowCursor(-1)) {
return nil;
} else {
return [UIPointerStyle hiddenPointerStyle];
}
}
#endif /* !TARGET_OS_TV && __IPHONE_13_4 */

- (SDL_TouchDeviceType)touchTypeForTouch:(UITouch *)touch
Expand Down

0 comments on commit 171ba00

Please sign in to comment.