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