mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
Fix backspace on android with api 30+
This commit is contained in:
committed by
Sam Lantinga
parent
e7199cad0b
commit
01bd8b3780
@@ -65,17 +65,15 @@ class SDLInputConnection extends BaseInputConnection
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
|
||||||
if (Build.VERSION.SDK_INT <= 29 /* Android 10.0 (Q) */) {
|
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions>/14560344/android-backspace-in-webview-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
|
||||||
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
|
if (beforeLength > 0 && afterLength == 0) {
|
||||||
if (beforeLength > 0 && afterLength == 0) {
|
// backspace(s)
|
||||||
// backspace(s)
|
while (beforeLength-- > 0) {
|
||||||
while (beforeLength-- > 0) {
|
nativeGenerateScancodeForUnichar('\b');
|
||||||
nativeGenerateScancodeForUnichar('\b');
|
}
|
||||||
}
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user