Commit ce45fa28e2131095eefce9f86034b4126e649953

Ryan C. Gordon 2013-10-02T22:18:04

SDLK_DELETE should probably be SDLK_BACKSPACE on iOS. The key on the software keyboard works like backspace, at least. Not sure what happens with a bluetooth keyboard here.

diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m
index e808962..66129be 100644
--- a/src/video/uikit/SDL_uikitview.m
+++ b/src/video/uikit/SDL_uikitview.m
@@ -246,8 +246,8 @@
 {
     if ([string length] == 0) {
         /* it wants to replace text with nothing, ie a delete */
-        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE);
-        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE);
+        SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE);
+        SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE);
     }
     else {
         /* go through all the characters in the string we've been sent
diff --git a/src/video/uikit/keyinfotable.h b/src/video/uikit/keyinfotable.h
index d12674b..d588f91 100644
--- a/src/video/uikit/keyinfotable.h
+++ b/src/video/uikit/keyinfotable.h
@@ -166,7 +166,7 @@ static UIKitKeyInfo unicharToUIKeyInfoTable[] = {
 /*  124 */{    SDL_SCANCODE_BACKSLASH, KMOD_SHIFT },    /* plus shift modifier '|' */
 /*  125 */{    SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT },    /* plus shift modifier '}' */
 /*  126 */{    SDL_SCANCODE_GRAVE, KMOD_SHIFT },         /* plus shift modifier '~' */
-/*  127 */{    SDL_SCANCODE_DELETE, KMOD_SHIFT }
+/*  127 */{    SDL_SCANCODE_BACKSPACE, KMOD_SHIFT }
 };
 
 #endif /* UIKitKeyInfo */