Skip to content

Commit

Permalink
Don't build iOS mouse support on Apple TV
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 13, 2020
1 parent e5d3629 commit cab1ee9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/video/uikit/SDL_uikitview.h
Expand Up @@ -25,7 +25,7 @@

#include "SDL_touch.h"

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
@interface SDL_uikitview : UIView <UIPointerInteractionDelegate>
#else
@interface SDL_uikitview : UIView
Expand All @@ -35,7 +35,7 @@

- (void)setSDLWindow:(SDL_Window *)window;

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

Expand Down
12 changes: 6 additions & 6 deletions src/video/uikit/SDL_uikitview.m
Expand Up @@ -76,7 +76,7 @@ - (instancetype)initWithFrame:(CGRect)frame
SDL_AddTouch(directTouchId, SDL_TOUCH_DEVICE_DIRECT, "");
#endif

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
[self addInteraction:[[UIPointerInteraction alloc] initWithDelegate:self]];
}
Expand Down Expand Up @@ -142,7 +142,7 @@ - (void)setSDLWindow:(SDL_Window *)window
sdlwindow = window;
}

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
- (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regionForRequest:(UIPointerRegionRequest *)request defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)){
if (request != nil) {
CGPoint origin = self.bounds.origin;
Expand All @@ -155,7 +155,7 @@ - (UIPointerRegion *)pointerInteraction:(UIPointerInteraction *)interaction regi
}
return defaultRegion;
}
#endif /* __IPHONE_13_4 */
#endif /* !TARGET_OS_TV && __IPHONE_13_4 */

- (SDL_TouchDeviceType)touchTypeForTouch:(UITouch *)touch
{
Expand Down Expand Up @@ -210,7 +210,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
for (UITouch *touch in touches) {
BOOL handled = NO;

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
if (touch.type == UITouchTypeIndirectPointer) {
/* FIXME: How can we tell the difference between left and right button clicks? */
Expand Down Expand Up @@ -242,7 +242,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
for (UITouch *touch in touches) {
BOOL handled = NO;

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
if (touch.type == UITouchTypeIndirectPointer) {
/* FIXME: How can we tell the difference between left and right button clicks? */
Expand Down Expand Up @@ -279,7 +279,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
for (UITouch *touch in touches) {
BOOL handled = NO;

#ifdef __IPHONE_13_4
#if !TARGET_OS_TV && defined(__IPHONE_13_4)
if (@available(iOS 13.4, *)) {
if (touch.type == UITouchTypeIndirectPointer) {
/* Already handled in pointerInteraction callback */
Expand Down

0 comments on commit cab1ee9

Please sign in to comment.