1
0
Fork 0

slightly increased the Backspace swiping sensitivity

This commit is contained in:
sspanak 2025-01-07 18:01:52 +02:00 committed by Dimo Karaivanov
parent 7864c24850
commit 7aa3ab5102
2 changed files with 32 additions and 3 deletions

View file

@ -78,9 +78,31 @@ public class SoftKeyBackspace extends SwipeableKey {
@Override @Override
protected void handleStartSwipeX(float position, float delta) { protected void handleStartSwipeX(float position, float delta) {
if (!isActionPerformed && validateTT9Handler()) { if (!isActionPerformed) {
isActionPerformed = true; isActionPerformed = true;
tt9.onBackspace(SettingsStore.BACKSPACE_ACCELERATION_REPEAT_DEBOUNCE); deleteWord();
}
}
@Override
protected void handleSwipeX(float position, float delta) {
handleStartSwipeX(position, delta);
}
@Override
protected void handleEndSwipeX(float position, float delta) {
if (isActionPerformed) {
return;
}
isActionPerformed = true;
if (delta < SWIPE_X_THRESHOLD) {
deleteText();
} else {
deleteWord();
} }
} }
@ -112,6 +134,13 @@ public class SoftKeyBackspace extends SwipeableKey {
} }
private void deleteWord() {
if (validateTT9Handler()) {
tt9.onBackspace(SettingsStore.BACKSPACE_ACCELERATION_REPEAT_DEBOUNCE);
}
}
@Override @Override
protected int getNoEmojiTitle() { protected int getNoEmojiTitle() {
return R.string.virtual_key_del; return R.string.virtual_key_del;

View file

@ -29,7 +29,7 @@ abstract public class SwipeableKey extends SoftKey {
private int swipeCount = 0; private int swipeCount = 0;
private long swipeProcessingTime = 0; private long swipeProcessingTime = 0;
private long swipeProcessingTimeAverage = 40; private long swipeProcessingTimeAverage = 50;
public SwipeableKey(Context context) { public SwipeableKey(Context context) {