mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Release previously pressed key even when the up event points new key
Bug: 6457266 Change-Id: I52c9fe88791d2c3a4385dfa457f07da160c60699
This commit is contained in:
parent
c8bde75cf4
commit
5a40dcaf8b
@ -606,7 +606,7 @@ public class PointerTracker {
|
|||||||
if (ProductionFlag.IS_EXPERIMENTAL) {
|
if (ProductionFlag.IS_EXPERIMENTAL) {
|
||||||
ResearchLogger.pointerTracker_onMoveEvent(x, y, lastX, lastY);
|
ResearchLogger.pointerTracker_onMoveEvent(x, y, lastX, lastY);
|
||||||
}
|
}
|
||||||
onUpEventInternal(lastX, lastY, eventTime);
|
onUpEventInternal();
|
||||||
onDownEventInternal(x, y, eventTime);
|
onDownEventInternal(x, y, eventTime);
|
||||||
} else {
|
} else {
|
||||||
mKeyAlreadyProcessed = true;
|
mKeyAlreadyProcessed = true;
|
||||||
@ -646,7 +646,7 @@ public class PointerTracker {
|
|||||||
}
|
}
|
||||||
queue.remove(this);
|
queue.remove(this);
|
||||||
}
|
}
|
||||||
onUpEventInternal(x, y, eventTime);
|
onUpEventInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let this pointer tracker know that one of newer-than-this pointer trackers got an up event.
|
// Let this pointer tracker know that one of newer-than-this pointer trackers got an up event.
|
||||||
@ -655,24 +655,15 @@ public class PointerTracker {
|
|||||||
public void onPhantomUpEvent(int x, int y, long eventTime) {
|
public void onPhantomUpEvent(int x, int y, long eventTime) {
|
||||||
if (DEBUG_EVENT)
|
if (DEBUG_EVENT)
|
||||||
printTouchEvent("onPhntEvent:", x, y, eventTime);
|
printTouchEvent("onPhntEvent:", x, y, eventTime);
|
||||||
onUpEventInternal(x, y, eventTime);
|
onUpEventInternal();
|
||||||
mKeyAlreadyProcessed = true;
|
mKeyAlreadyProcessed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onUpEventInternal(int x, int y, long eventTime) {
|
private void onUpEventInternal() {
|
||||||
mTimerProxy.cancelKeyTimers();
|
mTimerProxy.cancelKeyTimers();
|
||||||
mIsInSlidingKeyInput = false;
|
mIsInSlidingKeyInput = false;
|
||||||
final int keyX, keyY;
|
// Release the last pressed key.
|
||||||
if (isMajorEnoughMoveToBeOnNewKey(x, y, onMoveKey(x, y))) {
|
setReleasedKeyGraphics(mCurrentKey);
|
||||||
keyX = x;
|
|
||||||
keyY = y;
|
|
||||||
} else {
|
|
||||||
// Use previous fixed key coordinates.
|
|
||||||
keyX = mKeyX;
|
|
||||||
keyY = mKeyY;
|
|
||||||
}
|
|
||||||
final Key key = onUpKey(keyX, keyY, eventTime);
|
|
||||||
setReleasedKeyGraphics(key);
|
|
||||||
if (mIsShowingMoreKeysPanel) {
|
if (mIsShowingMoreKeysPanel) {
|
||||||
mDrawingProxy.dismissMoreKeysPanel();
|
mDrawingProxy.dismissMoreKeysPanel();
|
||||||
mIsShowingMoreKeysPanel = false;
|
mIsShowingMoreKeysPanel = false;
|
||||||
@ -680,7 +671,7 @@ public class PointerTracker {
|
|||||||
if (mKeyAlreadyProcessed)
|
if (mKeyAlreadyProcessed)
|
||||||
return;
|
return;
|
||||||
if (!mIsRepeatableKey) {
|
if (!mIsRepeatableKey) {
|
||||||
detectAndSendKey(key, keyX, keyY);
|
detectAndSendKey(mCurrentKey, mKeyX, mKeyY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user