Skip to content

Commit

Permalink
Added support for Bluetooth keyboards on iOS
Browse files Browse the repository at this point in the history
In this case the keyboard is shown and immediately hidden, but we still want to accept text input
  • Loading branch information
slouken committed May 20, 2019
1 parent 582a3c9 commit a4e33b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/uikit/SDL_uikitviewcontroller.m
Expand Up @@ -73,6 +73,7 @@ @implementation SDL_uikitviewcontroller {

#if SDL_IPHONE_KEYBOARD
UITextField *textField;
BOOL showingKeyboard;
BOOL rotatingOrientation;
NSString *changeText;
NSString *obligateForBackspace;
Expand Down Expand Up @@ -328,7 +329,9 @@ - (void)showKeyboard
{
keyboardVisible = YES;
if (textField.window) {
showingKeyboard = YES;
[textField becomeFirstResponder];
showingKeyboard = NO;
}
}

Expand All @@ -354,7 +357,7 @@ - (void)keyboardWillShow:(NSNotification *)notification

- (void)keyboardWillHide:(NSNotification *)notification
{
if (!rotatingOrientation) {
if (!showingKeyboard && !rotatingOrientation) {
SDL_StopTextInput();
}
[self setKeyboardHeight:0];
Expand Down

0 comments on commit a4e33b9

Please sign in to comment.