mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-19 16:30:19 +00:00
reduce sensitivty of space / delete gestures
This commit is contained in:
parent
25d5510f18
commit
8938e2d3ab
1 changed files with 4 additions and 2 deletions
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.dslul.openboard.inputmethod.keyboard;
|
package org.dslul.openboard.inputmethod.keyboard;
|
||||||
|
|
||||||
|
import static java.lang.Math.abs;
|
||||||
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
@ -907,7 +909,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
||||||
if (oldKey != null && oldKey.getCode() == Constants.CODE_SPACE && Settings.getInstance().getCurrent().mSpaceTrackpadEnabled) {
|
if (oldKey != null && oldKey.getCode() == Constants.CODE_SPACE && Settings.getInstance().getCurrent().mSpaceTrackpadEnabled) {
|
||||||
//Pointer slider
|
//Pointer slider
|
||||||
int steps = (x - mStartX) / sPointerStep;
|
int steps = (x - mStartX) / sPointerStep;
|
||||||
final int longpressTimeout = Settings.getInstance().getCurrent().mKeyLongpressTimeout / MULTIPLIER_FOR_LONG_PRESS_TIMEOUT_IN_SLIDING_INPUT;
|
final int longpressTimeout = 2 * Settings.getInstance().getCurrent().mKeyLongpressTimeout / MULTIPLIER_FOR_LONG_PRESS_TIMEOUT_IN_SLIDING_INPUT;
|
||||||
if (steps != 0 && mStartTime + longpressTimeout < System.currentTimeMillis()) {
|
if (steps != 0 && mStartTime + longpressTimeout < System.currentTimeMillis()) {
|
||||||
mCursorMoved = true;
|
mCursorMoved = true;
|
||||||
mStartX += steps * sPointerStep;
|
mStartX += steps * sPointerStep;
|
||||||
|
@ -919,7 +921,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element,
|
||||||
if (oldKey != null && oldKey.getCode() == Constants.CODE_DELETE && Settings.getInstance().getCurrent().mDeleteSwipeEnabled) {
|
if (oldKey != null && oldKey.getCode() == Constants.CODE_DELETE && Settings.getInstance().getCurrent().mDeleteSwipeEnabled) {
|
||||||
//Delete slider
|
//Delete slider
|
||||||
int steps = (x - mStartX) / sPointerStep;
|
int steps = (x - mStartX) / sPointerStep;
|
||||||
if (steps != 0) {
|
if (abs(steps) > 2 || (mCursorMoved && steps != 0)) {
|
||||||
sTimerProxy.cancelKeyTimersOf(this);
|
sTimerProxy.cancelKeyTimersOf(this);
|
||||||
mCursorMoved = true;
|
mCursorMoved = true;
|
||||||
mStartX += steps * sPointerStep;
|
mStartX += steps * sPointerStep;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue