Fixed bug #1025 (iphone keyboard doesn't send 'return' and 'backspace' events)
authorSam Lantinga <slouken@libsdl.org>
Tue, 01 Feb 2011 09:04:43 -0800
changeset 5134c63b901d97ab
parent 5133 b915b3181cc2
child 5135 aee04c635ec6
Fixed bug #1025 (iphone keyboard doesn't send 'return' and 'backspace' events)

Vittorio Giovara 2011-02-01 02:25:48 PST

i have attached an updated patch that fixes this behaviour
src/video/uikit/SDL_uikitview.m
src/video/uikit/keyinfotable.h
     1.1 --- a/src/video/uikit/SDL_uikitview.m	Tue Feb 01 09:02:53 2011 -0800
     1.2 +++ b/src/video/uikit/SDL_uikitview.m	Tue Feb 01 09:04:43 2011 -0800
     1.3 @@ -298,6 +298,7 @@
     1.4  
     1.5  /* Terminates the editing session */
     1.6  - (BOOL)textFieldShouldReturn:(UITextField*)_textField {
     1.7 +    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
     1.8      [self hideKeyboard];
     1.9      return YES;
    1.10  }
     2.1 --- a/src/video/uikit/keyinfotable.h	Tue Feb 01 09:02:53 2011 -0800
     2.2 +++ b/src/video/uikit/keyinfotable.h	Tue Feb 01 09:04:43 2011 -0800
     2.3 @@ -54,7 +54,7 @@
     2.4  /*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
     2.5  /*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
     2.6  /*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
     2.7 -/*  13 */ {   SDL_SCANCODE_UNKNOWN, 0 },
     2.8 +/*  13 */ {   SDL_SCANCODE_RETURN, 0 },
     2.9  /*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
    2.10  /*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
    2.11  /*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
    2.12 @@ -137,7 +137,7 @@
    2.13  /*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
    2.14  /*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },            /* plus shift modifier '^' */
    2.15  /*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },        /* plus shift modifier '_' */
    2.16 -/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },        /* '`'
    2.17 +/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },        /* '`' */
    2.18  /*  97 */ {   SDL_SCANCODE_A, 0    },    
    2.19  /*  98 */ {   SDL_SCANCODE_B, 0 },
    2.20  /*  99 */ {   SDL_SCANCODE_C, 0 },