mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Use CODE_DELETE instead of KEYCODE_DEL event for delete pointer
This commit is contained in:
parent
12110e96aa
commit
9410e5a825
@ -1399,14 +1399,21 @@ public class LatinIMELegacy implements KeyboardActionListener,
|
||||
mInputLogic.mConnection.setSelection(start, end);
|
||||
} else {
|
||||
for (; steps < 0; steps++)
|
||||
mInputLogic.sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL, 0);
|
||||
onCodeInput(
|
||||
Constants.CODE_DELETE,
|
||||
Constants.NOT_A_COORDINATE,
|
||||
Constants.NOT_A_COORDINATE, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpWithDeletePointerActive() {
|
||||
if (mInputLogic.mConnection.hasSelection())
|
||||
mInputLogic.sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL, 0);
|
||||
if (mInputLogic.mConnection.hasSelection()) {
|
||||
onCodeInput(
|
||||
Constants.CODE_DELETE,
|
||||
Constants.NOT_A_COORDINATE,
|
||||
Constants.NOT_A_COORDINATE, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2429,6 +2429,9 @@ public final class InputLogic {
|
||||
end = cursor;
|
||||
}
|
||||
|
||||
start = Math.max(0, start);
|
||||
end = Math.max(0, end);
|
||||
|
||||
mConnection.setSelection(start, end);
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,14 @@ object EmojiTracker {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun Context.unuseEmoji(emoji: String) {
|
||||
dataStore.edit {
|
||||
val split = (it[lastUsedEmoji] ?: "").split("<|>")
|
||||
val idxToRemove = split.indexOfFirst { v -> v == emoji }
|
||||
it[lastUsedEmoji] = split.filterIndexed { i, _ -> i != idxToRemove}.joinToString("<|>")
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun Context.getRecentEmojis(): List<String> {
|
||||
return getSetting(lastUsedEmoji, "")
|
||||
.split("<|>")
|
||||
|
Loading…
Reference in New Issue
Block a user