Commit 6d3ce729a669d500cd073b18207eb27c567767c3

Sam Lantinga 2022-07-05T21:39:33

Merge commit '7ac5d616f3732b4d98010331d2ae0a24f883092d' into main

diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index eea0b9c..8ad4f17 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -2390,14 +2390,11 @@ class SDLInputConnection extends BaseInputConnection {
         // Workaround to capture backspace key. Ref: http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection
         // and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
         if (beforeLength > 0 && afterLength == 0) {
-            boolean ret = true;
             // backspace(s)
             while (beforeLength-- > 0) {
-               boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
-                              && sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
-               ret = ret && ret_key;
+                nativeGenerateScancodeForUnichar('\b');
             }
-            return ret;
+            return true;
         }
 
         return super.deleteSurroundingText(beforeLength, afterLength);
diff --git a/src/events/scancodes_ascii.h b/src/events/scancodes_ascii.h
index 47067fb..d46331c 100644
--- a/src/events/scancodes_ascii.h
+++ b/src/events/scancodes_ascii.h
@@ -45,7 +45,7 @@ static ASCIIKeyInfo SDL_ASCIIKeyInfoTable[] = {
 /*   5 */ { SDL_SCANCODE_UNKNOWN, 0 },
 /*   6 */ { SDL_SCANCODE_UNKNOWN, 0 },
 /*   7 */ { SDL_SCANCODE_UNKNOWN, 0 },
-/*   8 */ { SDL_SCANCODE_UNKNOWN, 0 },
+/*   8 */ { SDL_SCANCODE_BACKSPACE, 0 },
 /*   9 */ { SDL_SCANCODE_UNKNOWN, 0 },
 /*  10 */ { SDL_SCANCODE_UNKNOWN, 0 },
 /*  11 */ { SDL_SCANCODE_UNKNOWN, 0 },