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);
|
mInputLogic.mConnection.setSelection(start, end);
|
||||||
} else {
|
} else {
|
||||||
for (; steps < 0; steps++)
|
for (; steps < 0; steps++)
|
||||||
mInputLogic.sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL, 0);
|
onCodeInput(
|
||||||
|
Constants.CODE_DELETE,
|
||||||
|
Constants.NOT_A_COORDINATE,
|
||||||
|
Constants.NOT_A_COORDINATE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpWithDeletePointerActive() {
|
public void onUpWithDeletePointerActive() {
|
||||||
if (mInputLogic.mConnection.hasSelection())
|
if (mInputLogic.mConnection.hasSelection()) {
|
||||||
mInputLogic.sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL, 0);
|
onCodeInput(
|
||||||
|
Constants.CODE_DELETE,
|
||||||
|
Constants.NOT_A_COORDINATE,
|
||||||
|
Constants.NOT_A_COORDINATE, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2429,6 +2429,9 @@ public final class InputLogic {
|
|||||||
end = cursor;
|
end = cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start = Math.max(0, start);
|
||||||
|
end = Math.max(0, end);
|
||||||
|
|
||||||
mConnection.setSelection(start, 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> {
|
suspend fun Context.getRecentEmojis(): List<String> {
|
||||||
return getSetting(lastUsedEmoji, "")
|
return getSetting(lastUsedEmoji, "")
|
||||||
.split("<|>")
|
.split("<|>")
|
||||||
|
Loading…
Reference in New Issue
Block a user