mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-02-04 11:15:57 +01:00
Added support for Bluetooth keyboards on iOS
In this case the keyboard is shown and immediately hidden, but we still want to accept text input
This commit is contained in:
parent
582a3c994d
commit
a4e33b9cc4
@ -73,6 +73,7 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
|
|||||||
|
|
||||||
#if SDL_IPHONE_KEYBOARD
|
#if SDL_IPHONE_KEYBOARD
|
||||||
UITextField *textField;
|
UITextField *textField;
|
||||||
|
BOOL showingKeyboard;
|
||||||
BOOL rotatingOrientation;
|
BOOL rotatingOrientation;
|
||||||
NSString *changeText;
|
NSString *changeText;
|
||||||
NSString *obligateForBackspace;
|
NSString *obligateForBackspace;
|
||||||
@ -328,7 +329,9 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
|
|||||||
{
|
{
|
||||||
keyboardVisible = YES;
|
keyboardVisible = YES;
|
||||||
if (textField.window) {
|
if (textField.window) {
|
||||||
|
showingKeyboard = YES;
|
||||||
[textField becomeFirstResponder];
|
[textField becomeFirstResponder];
|
||||||
|
showingKeyboard = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,7 +357,7 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
|
|||||||
|
|
||||||
- (void)keyboardWillHide:(NSNotification *)notification
|
- (void)keyboardWillHide:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
if (!rotatingOrientation) {
|
if (!showingKeyboard && !rotatingOrientation) {
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
}
|
}
|
||||||
[self setKeyboardHeight:0];
|
[self setKeyboardHeight:0];
|
||||||
|
Loading…
Reference in New Issue
Block a user