mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-19 21:59:11 +00:00
use backspace key event instead of deleteSurroundingText when a browser claims it does not have text before the cursor
fixes #1337
This commit is contained in:
parent
7c77f4d1c4
commit
c0b3e76741
1 changed files with 7 additions and 1 deletions
|
@ -1302,7 +1302,13 @@ public final class InputLogic {
|
||||||
// broken apps expect something to happen in this case so that they can
|
// broken apps expect something to happen in this case so that they can
|
||||||
// catch it and have their broken interface react. If you need the keyboard
|
// catch it and have their broken interface react. If you need the keyboard
|
||||||
// to do this, you're doing it wrong -- please fix your app.
|
// to do this, you're doing it wrong -- please fix your app.
|
||||||
mConnection.deleteTextBeforeCursor(1);
|
// To make this more interesting, web browsers, and apps that are basically
|
||||||
|
// browsers under the hood, in too many cases don't understand "deleteSurroundingText".
|
||||||
|
// So we try to send a backspace keypress instead.
|
||||||
|
if ((getCurrentInputEditorInfo().inputType & InputType.TYPE_MASK_VARIATION)
|
||||||
|
== InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT)
|
||||||
|
sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL);
|
||||||
|
else mConnection.deleteTextBeforeCursor(1);
|
||||||
// TODO: Add a new StatsUtils method onBackspaceWhenNoText()
|
// TODO: Add a new StatsUtils method onBackspaceWhenNoText()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue