diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index c35864897b..dab0e54cdf 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -412,7 +412,9 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; SDL_SendKeyboardKey(SDL_PRESSED, scancode); } } - [super pressesBegan:presses withEvent:event]; + if (SDL_TextInputActive()) { + [super pressesBegan:presses withEvent:event]; + } } - (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)event @@ -423,7 +425,9 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } - [super pressesEnded:presses withEvent:event]; + if (SDL_TextInputActive()) { + [super pressesEnded:presses withEvent:event]; + } } - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent *)event @@ -434,13 +438,17 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick; SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } - [super pressesCancelled:presses withEvent:event]; + if (SDL_TextInputActive()) { + [super pressesCancelled:presses withEvent:event]; + } } - (void)pressesChanged:(NSSet *)presses withEvent:(UIPressesEvent *)event { /* This is only called when the force of a press changes. */ - [super pressesChanged:presses withEvent:event]; + if (SDL_TextInputActive()) { + [super pressesChanged:presses withEvent:event]; + } } #endif /* TARGET_OS_TV || defined(__IPHONE_9_1) */