Skip to content

Commit

Permalink
just use code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
devycarol committed Jun 30, 2024
1 parent a30d00c commit f4a1eef
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,13 @@ private void dragFingerOutFromOldKey(final Key oldKey, final int x, final int y)
}
}

private boolean keySwipe(final Key key, final int x, final int y, final long eventTime) {
private boolean keySwipe(final int code, final int x, final int y, final long eventTime) {
final SettingsValues sv = Settings.getInstance().getCurrent();
final int fastTypingTimeout = 3 * sv.mKeyLongpressTimeout / 4;
// we don't want keyswipes to start immediately if the user is fast-typing,
// see https://github.com/openboard-team/openboard/issues/411
if (System.currentTimeMillis() < mStartTime + fastTypingTimeout && sTypingTimeRecorder.isInFastTyping(eventTime))
return true;
final int code = key.getCode();
if (code == Constants.CODE_SPACE) {
int dX = x - mStartX;
int dY = y - mStartY;
Expand Down Expand Up @@ -935,7 +934,7 @@ private void onMoveEventInternal(final int x, final int y, final long eventTime)
final Key oldKey = mCurrentKey;

// todo (later): extend key swipe stuff
if (mKeySwipeAllowed && keySwipe(oldKey, x, y, eventTime))
if (mKeySwipeAllowed && keySwipe(oldKey.getCode(), x, y, eventTime))
return;

final Key newKey = onMoveKey(x, y);
Expand Down

0 comments on commit f4a1eef

Please sign in to comment.