src/video/uikit/SDL_uikitview.m
author Alex Szpakowski <slime73@gmail.com>
Tue, 29 Jul 2014 00:36:12 -0300
branchiOS-improvements
changeset 9506 18e3f94bd860
parent 9505 6fc615dfc93f
child 9510 e19faa3b5d88
permissions -rw-r--r--
Added missing autorelease pool blocks in UIKit backend code. Fixes memory leak issues, especially in SDL_video.
slouken@6079
     1
 /*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@8149
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
slouken@5262
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@5262
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@5262
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@5262
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@6044
    22
slouken@6044
    23
#if SDL_VIDEO_DRIVER_UIKIT
slouken@2765
    24
slouken@6518
    25
#include "SDL_uikitview.h"
slouken@2765
    26
slouken@4490
    27
#include "../../events/SDL_keyboard_c.h"
slouken@4490
    28
#include "../../events/SDL_mouse_c.h"
jimtla@4677
    29
#include "../../events/SDL_touch_c.h"
slouken@4490
    30
slouken@2765
    31
#if SDL_IPHONE_KEYBOARD
slouken@6518
    32
#include "keyinfotable.h"
urkle@7111
    33
#endif
slouken@6518
    34
#include "SDL_uikitappdelegate.h"
slouken@6518
    35
#include "SDL_uikitmodes.h"
slouken@6518
    36
#include "SDL_uikitwindow.h"
slouken@2765
    37
slime73@9487
    38
void _uikit_keyboard_init();
slouken@7962
    39
slime73@9501
    40
@implementation SDL_uikitview {
slime73@9501
    41
slime73@9501
    42
    SDL_TouchID touchId;
slime73@9501
    43
    UITouch *leftFingerDown;
slime73@9501
    44
#ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
slime73@9501
    45
    UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
slime73@9501
    46
#endif
slime73@9501
    47
slime73@9501
    48
#if SDL_IPHONE_KEYBOARD
slime73@9501
    49
    UITextField *textField;
slime73@9501
    50
#endif
slime73@9501
    51
slime73@9501
    52
}
slouken@2765
    53
kees@6003
    54
- (id)initWithFrame:(CGRect)frame
kees@6003
    55
{
slime73@9505
    56
    if (self = [super initWithFrame: frame]) {
slouken@2765
    57
#if SDL_IPHONE_KEYBOARD
slime73@9505
    58
        [self initializeKeyboard];
kees@6001
    59
#endif
slouken@2765
    60
slime73@9505
    61
        self.multipleTouchEnabled = YES;
slouken@5445
    62
slime73@9505
    63
        touchId = 1;
slime73@9505
    64
        SDL_AddTouch(touchId, "");
slime73@9505
    65
    }
slouken@4661
    66
slouken@5131
    67
    return self;
slouken@2765
    68
slouken@2765
    69
}
slouken@2765
    70
slouken@6436
    71
- (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize
slouken@6079
    72
{
slouken@6079
    73
    CGPoint point = [touch locationInView: self];
slouken@6436
    74
slouken@6436
    75
    if (normalize) {
slime73@9501
    76
        CGRect bounds = self.bounds;
slouken@6439
    77
        point.x /= bounds.size.width;
slouken@6439
    78
        point.y /= bounds.size.height;
slouken@6436
    79
    }
slime73@9488
    80
slouken@6079
    81
    return point;
slouken@6079
    82
}
slouken@6079
    83
kees@6003
    84
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
kees@6003
    85
{
slime73@9487
    86
    for (UITouch *touch in touches) {
slouken@6597
    87
        if (!leftFingerDown) {
slouken@6597
    88
            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
kees@6001
    89
slouken@6597
    90
            /* send moved event */
slime73@9487
    91
            SDL_SendMouseMotion(viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
slouken@4488
    92
slouken@6597
    93
            /* send mouse down event */
slime73@9487
    94
            SDL_SendMouseButton(viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
jim@4660
    95
icculus@7050
    96
            leftFingerDown = touch;
slouken@6597
    97
        }
slouken@6597
    98
slouken@6436
    99
        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
jim@4662
   100
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
slouken@7191
   101
        /* FIXME: TODO: Using touch as the fingerId is potentially dangerous
slouken@7191
   102
         * It is also much more efficient than storing the UITouch pointer
slouken@7191
   103
         * and comparing it to the incoming event.
slouken@7191
   104
         */
icculus@7050
   105
        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
slouken@6951
   106
                      SDL_TRUE, locationInView.x, locationInView.y, 1.0f);
jim@4662
   107
#else
kees@6003
   108
        int i;
kees@6003
   109
        for(i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
kees@6003
   110
            if (finger[i] == NULL) {
kees@6003
   111
                finger[i] = touch;
slouken@6951
   112
                SDL_SendTouch(touchId, i,
slouken@6951
   113
                              SDL_TRUE, locationInView.x, locationInView.y, 1.0f);
kees@6003
   114
                break;
kees@6003
   115
            }
slouken@5131
   116
        }
jim@4662
   117
#endif
slouken@5131
   118
    }
slouken@2765
   119
}
slouken@2765
   120
kees@6003
   121
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
kees@6003
   122
{
slime73@9487
   123
    for (UITouch *touch in touches) {
icculus@7050
   124
        if (touch == leftFingerDown) {
slouken@6597
   125
            /* send mouse up */
slime73@9487
   126
            SDL_SendMouseButton(viewcontroller.window, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
icculus@7050
   127
            leftFingerDown = nil;
slouken@6597
   128
        }
slouken@4661
   129
slouken@6436
   130
        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
jim@4662
   131
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
slime73@9501
   132
        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
slouken@6951
   133
                      SDL_FALSE, locationInView.x, locationInView.y, 1.0f);
jim@4662
   134
#else
kees@6003
   135
        int i;
kees@6003
   136
        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
kees@6003
   137
            if (finger[i] == touch) {
slouken@6951
   138
                SDL_SendTouch(touchId, i,
slouken@6951
   139
                              SDL_FALSE, locationInView.x, locationInView.y, 1.0f);
kees@6003
   140
                finger[i] = NULL;
kees@6003
   141
                break;
kees@6003
   142
            }
slouken@5131
   143
        }
jim@4662
   144
#endif
slouken@5131
   145
    }
slouken@2765
   146
}
slouken@2765
   147
kees@6003
   148
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
kees@6003
   149
{
slouken@5131
   150
    /*
slouken@5131
   151
        this can happen if the user puts more than 5 touches on the screen
slouken@5131
   152
        at once, or perhaps in other circumstances.  Usually (it seems)
slouken@5131
   153
        all active touches are canceled.
slouken@5131
   154
    */
slouken@5131
   155
    [self touchesEnded: touches withEvent: event];
slouken@2765
   156
}
slouken@2765
   157
kees@6003
   158
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
kees@6003
   159
{
slime73@9487
   160
    for (UITouch *touch in touches) {
icculus@7050
   161
        if (touch == leftFingerDown) {
slouken@6597
   162
            CGPoint locationInView = [self touchLocation:touch shouldNormalize:NO];
slouken@4488
   163
slouken@6597
   164
            /* send moved event */
slime73@9487
   165
            SDL_SendMouseMotion(viewcontroller.window, SDL_TOUCH_MOUSEID, 0, locationInView.x, locationInView.y);
slouken@6597
   166
        }
jim@4660
   167
slouken@6436
   168
        CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
jim@4662
   169
#ifdef IPHONE_TOUCH_EFFICIENT_DANGEROUS
slime73@9501
   170
        SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
slouken@6951
   171
                            locationInView.x, locationInView.y, 1.0f);
jim@4662
   172
#else
kees@6003
   173
        int i;
kees@6003
   174
        for (i = 0; i < MAX_SIMULTANEOUS_TOUCHES; i++) {
kees@6003
   175
            if (finger[i] == touch) {
kees@6003
   176
                SDL_SendTouchMotion(touchId, i,
slouken@6951
   177
                                    locationInView.x, locationInView.y, 1.0f);
kees@6003
   178
                break;
kees@6003
   179
            }
slouken@5131
   180
        }
jim@4662
   181
#endif
slouken@5131
   182
    }
slouken@2765
   183
}
slouken@2765
   184
slouken@2765
   185
/*
slouken@5131
   186
    ---- Keyboard related functionality below this line ----
slouken@2765
   187
*/
slouken@2765
   188
#if SDL_IPHONE_KEYBOARD
slouken@2765
   189
slime73@9501
   190
@synthesize textInputRect;
slime73@9501
   191
@synthesize keyboardHeight;
slime73@9501
   192
@synthesize keyboardVisible;
slouken@2765
   193
slouken@2765
   194
/* Set ourselves up as a UITextFieldDelegate */
kees@6003
   195
- (void)initializeKeyboard
kees@6003
   196
{
slouken@5131
   197
    textField = [[UITextField alloc] initWithFrame: CGRectZero];
slouken@5131
   198
    textField.delegate = self;
slouken@5131
   199
    /* placeholder so there is something to delete! */
kees@6001
   200
    textField.text = @" ";
kees@6001
   201
slouken@5131
   202
    /* set UITextInputTrait properties, mostly to defaults */
slouken@5131
   203
    textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
slouken@5131
   204
    textField.autocorrectionType = UITextAutocorrectionTypeNo;
slouken@5131
   205
    textField.enablesReturnKeyAutomatically = NO;
slouken@5131
   206
    textField.keyboardAppearance = UIKeyboardAppearanceDefault;
slouken@5131
   207
    textField.keyboardType = UIKeyboardTypeDefault;
slouken@5131
   208
    textField.returnKeyType = UIReturnKeyDefault;
kees@6001
   209
    textField.secureTextEntry = NO;
kees@6001
   210
slouken@5131
   211
    textField.hidden = YES;
slouken@5131
   212
    keyboardVisible = NO;
slouken@5131
   213
    /* add the UITextField (hidden) to our view */
slouken@5131
   214
    [self addSubview: textField];
slouken@5131
   215
    [textField release];
slouken@7962
   216
    
slouken@7962
   217
    _uikit_keyboard_init();
slouken@2765
   218
}
slouken@2765
   219
slouken@2765
   220
/* reveal onscreen virtual keyboard */
kees@6003
   221
- (void)showKeyboard
kees@6003
   222
{
slouken@5131
   223
    keyboardVisible = YES;
slouken@5131
   224
    [textField becomeFirstResponder];
slouken@2765
   225
}
slouken@2765
   226
slouken@2765
   227
/* hide onscreen virtual keyboard */
kees@6003
   228
- (void)hideKeyboard
kees@6003
   229
{
slouken@5131
   230
    keyboardVisible = NO;
slouken@5131
   231
    [textField resignFirstResponder];
slouken@2765
   232
}
slouken@2765
   233
slouken@2765
   234
/* UITextFieldDelegate method.  Invoked when user types something. */
kees@6003
   235
- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
kees@6003
   236
{
slouken@5131
   237
    if ([string length] == 0) {
slouken@5131
   238
        /* it wants to replace text with nothing, ie a delete */
icculus@7774
   239
        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE);
icculus@7774
   240
        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE);
slouken@5131
   241
    }
slouken@5131
   242
    else {
slouken@5131
   243
        /* go through all the characters in the string we've been sent
slouken@5131
   244
           and convert them to key presses */
slouken@5131
   245
        int i;
kees@6003
   246
        for (i = 0; i < [string length]; i++) {
kees@6001
   247
slouken@5131
   248
            unichar c = [string characterAtIndex: i];
kees@6001
   249
slouken@5131
   250
            Uint16 mod = 0;
slouken@5218
   251
            SDL_Scancode code;
kees@6001
   252
slouken@5131
   253
            if (c < 127) {
slouken@5218
   254
                /* figure out the SDL_Scancode and SDL_keymod for this unichar */
slouken@5131
   255
                code = unicharToUIKeyInfoTable[c].code;
slouken@5131
   256
                mod  = unicharToUIKeyInfoTable[c].mod;
slouken@5131
   257
            }
slouken@5131
   258
            else {
slouken@5131
   259
                /* we only deal with ASCII right now */
slouken@5131
   260
                code = SDL_SCANCODE_UNKNOWN;
slouken@5131
   261
                mod = 0;
slouken@5131
   262
            }
kees@6001
   263
slouken@5131
   264
            if (mod & KMOD_SHIFT) {
slouken@5131
   265
                /* If character uses shift, press shift down */
slouken@5131
   266
                SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT);
slouken@5131
   267
            }
slouken@5131
   268
            /* send a keydown and keyup even for the character */
slouken@5131
   269
            SDL_SendKeyboardKey(SDL_PRESSED, code);
slouken@5131
   270
            SDL_SendKeyboardKey(SDL_RELEASED, code);
slouken@5131
   271
            if (mod & KMOD_SHIFT) {
slouken@5131
   272
                /* If character uses shift, press shift back up */
slouken@5131
   273
                SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT);
kees@6001
   274
            }
slouken@5131
   275
        }
slouken@5461
   276
        SDL_SendKeyboardText([string UTF8String]);
slouken@5131
   277
    }
slouken@5131
   278
    return NO; /* don't allow the edit! (keep placeholder text there) */
slouken@2765
   279
}
slouken@2765
   280
slouken@2765
   281
/* Terminates the editing session */
kees@6003
   282
- (BOOL)textFieldShouldReturn:(UITextField*)_textField
kees@6003
   283
{
slouken@5134
   284
    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
slouken@6054
   285
    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
slouken@6654
   286
    SDL_StopTextInput();
slouken@5131
   287
    return YES;
slouken@2765
   288
}
slouken@2765
   289
slouken@2765
   290
#endif
slouken@2765
   291
slouken@2765
   292
@end
slouken@2765
   293
slouken@2765
   294
/* iPhone keyboard addition functions */
slouken@2765
   295
#if SDL_IPHONE_KEYBOARD
slouken@2765
   296
slouken@6044
   297
static SDL_uikitview * getWindowView(SDL_Window * window)
kees@6010
   298
{
kees@6010
   299
    if (window == NULL) {
kees@6010
   300
        SDL_SetError("Window does not exist");
kees@6010
   301
        return nil;
kees@6010
   302
    }
kees@6010
   303
kees@6010
   304
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
kees@6010
   305
    SDL_uikitview *view = data != NULL ? data->view : nil;
kees@6010
   306
kees@6010
   307
    if (view == nil) {
kees@6010
   308
        SDL_SetError("Window has no view");
kees@6010
   309
    }
kees@6010
   310
kees@6010
   311
    return view;
kees@6010
   312
}
kees@6010
   313
slouken@6654
   314
SDL_bool UIKit_HasScreenKeyboardSupport(_THIS)
slouken@6392
   315
{
slouken@6392
   316
    return SDL_TRUE;
slouken@6392
   317
}
slouken@6392
   318
slouken@6654
   319
void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window)
kees@6003
   320
{
slime73@9506
   321
    @autoreleasepool {
slime73@9506
   322
        SDL_uikitview *view = getWindowView(window);
slime73@9506
   323
        if (view != nil) {
slime73@9506
   324
            [view showKeyboard];
slime73@9506
   325
        }
slouken@5131
   326
    }
slouken@2765
   327
}
slouken@2765
   328
slouken@6654
   329
void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window)
kees@6003
   330
{
slime73@9506
   331
    @autoreleasepool {
slime73@9506
   332
        SDL_uikitview *view = getWindowView(window);
slime73@9506
   333
        if (view != nil) {
slime73@9506
   334
            [view hideKeyboard];
slime73@9506
   335
        }
kees@6001
   336
    }
slouken@2765
   337
}
slouken@2765
   338
slouken@6392
   339
SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window)
kees@6003
   340
{
slime73@9506
   341
    @autoreleasepool {
slime73@9506
   342
        SDL_uikitview *view = getWindowView(window);
slime73@9506
   343
        if (view == nil) {
slime73@9506
   344
            return 0;
slime73@9506
   345
        }
slime73@9506
   346
slime73@9506
   347
        return view.isKeyboardVisible;
kees@6001
   348
    }
slouken@2765
   349
}
slouken@2765
   350
slouken@7962
   351
slouken@7962
   352
void _uikit_keyboard_update() {
slouken@7962
   353
    SDL_Window *window = SDL_GetFocusWindow();
slouken@7962
   354
    if (!window) { return; }
slouken@7962
   355
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
slouken@7962
   356
    if (!data) { return; }
slouken@7962
   357
    SDL_uikitview *view = data->view;
slouken@7962
   358
    if (!view) { return; }
slouken@7962
   359
    
slouken@7962
   360
    SDL_Rect r = view.textInputRect;
slouken@7962
   361
    int height = view.keyboardHeight;
slouken@7962
   362
    int offsetx = 0;
slouken@7962
   363
    int offsety = 0;
slouken@7962
   364
    if (height) {
slouken@7962
   365
        int sw,sh;
slouken@7962
   366
        SDL_GetWindowSize(window,&sw,&sh);
slouken@7962
   367
        int bottom = (r.y + r.h);
slouken@7962
   368
        int kbottom = sh - height;
slouken@7962
   369
        if (kbottom < bottom) {
slouken@7962
   370
            offsety = kbottom-bottom;
slouken@7962
   371
        }
slouken@7962
   372
    }
slouken@7962
   373
    UIInterfaceOrientation ui_orient = [[UIApplication sharedApplication] statusBarOrientation];
slouken@7962
   374
    if (ui_orient == UIInterfaceOrientationLandscapeLeft) {
slouken@7962
   375
        int tmp = offsetx; offsetx = offsety; offsety = tmp;
slouken@7962
   376
    }
slouken@7962
   377
    if (ui_orient == UIInterfaceOrientationLandscapeRight) {
slouken@7962
   378
        offsety = -offsety;
slouken@7962
   379
        int tmp = offsetx; offsetx = offsety; offsety = tmp;
slouken@7962
   380
    }
slouken@7962
   381
    if (ui_orient == UIInterfaceOrientationPortraitUpsideDown) {
slouken@7962
   382
        offsety = -offsety;
slouken@7962
   383
    }
slouken@8891
   384
slouken@7962
   385
    view.frame = CGRectMake(offsetx,offsety,view.frame.size.width,view.frame.size.height);
slouken@7962
   386
}
slouken@7962
   387
slouken@7962
   388
void _uikit_keyboard_set_height(int height) {
slouken@7962
   389
    SDL_uikitview *view = getWindowView(SDL_GetFocusWindow());
slouken@7962
   390
    if (view == nil) {
slime73@9503
   391
        return;
slouken@7962
   392
    }
slime73@9503
   393
slime73@9503
   394
    view.keyboardVisible = height > 0;
slouken@7962
   395
    view.keyboardHeight = height;
slouken@7962
   396
    _uikit_keyboard_update();
slouken@7962
   397
}
slouken@7962
   398
slouken@7962
   399
void _uikit_keyboard_init() {
slouken@7962
   400
    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
slouken@7962
   401
    NSOperationQueue *queue = [NSOperationQueue mainQueue];
slouken@7962
   402
    [center addObserverForName:UIKeyboardWillShowNotification
slouken@7962
   403
                        object:nil
slouken@7962
   404
                         queue:queue
slouken@7962
   405
                    usingBlock:^(NSNotification *notification) {
slouken@7962
   406
                        int height = 0;
slime73@9499
   407
                        CGSize keyboardSize = [[notification userInfo][UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
slouken@7962
   408
                        height = keyboardSize.height;
slouken@7962
   409
                        UIInterfaceOrientation ui_orient = [[UIApplication sharedApplication] statusBarOrientation];
slouken@7962
   410
                        if (ui_orient == UIInterfaceOrientationLandscapeRight || ui_orient == UIInterfaceOrientationLandscapeLeft) {
slouken@7962
   411
                            height = keyboardSize.width;
slouken@7962
   412
                        }
slouken@7962
   413
                        _uikit_keyboard_set_height(height);
slouken@7962
   414
                    }
slouken@7962
   415
     ];
slouken@7962
   416
    [center addObserverForName:UIKeyboardDidHideNotification
slouken@7962
   417
                        object:nil
slouken@7962
   418
                         queue:queue
slouken@7962
   419
                    usingBlock:^(NSNotification *notification) {
slouken@7962
   420
                        _uikit_keyboard_set_height(0);
slouken@7962
   421
                    }
slouken@7962
   422
     ];
slouken@7962
   423
}
slouken@7962
   424
slouken@7962
   425
void
slouken@7962
   426
UIKit_SetTextInputRect(_THIS, SDL_Rect *rect)
slouken@7962
   427
{
slouken@7962
   428
    if (!rect) {
slouken@7962
   429
        SDL_InvalidParamError("rect");
slouken@7962
   430
        return;
slouken@7962
   431
    }
slime73@9506
   432
slime73@9506
   433
    @autoreleasepool {
slime73@9506
   434
        SDL_uikitview *view = getWindowView(SDL_GetFocusWindow());
slime73@9506
   435
        if (view == nil) {
slime73@9506
   436
            return;
slime73@9506
   437
        }
slime73@9506
   438
slime73@9506
   439
        view.textInputRect = *rect;
slouken@7962
   440
    }
slouken@7962
   441
}
slouken@7962
   442
slouken@7962
   443
slouken@5132
   444
#endif /* SDL_IPHONE_KEYBOARD */
slouken@2765
   445
slouken@6044
   446
#endif /* SDL_VIDEO_DRIVER_UIKIT */
slouken@6044
   447
slouken@5132
   448
/* vi: set ts=4 sw=4 expandtab: */