Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
2a3b15b2
Commit
2a3b15b2
authored
12 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Flatten nested if-else blocks into plain if-else blocks (refactor step 2.5)
Change-Id: I42aad04658e14e8fd703e3828676719a333ec8f9
parent
3c6d3a4d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+32
-36
32 additions, 36 deletions
.../src/com/android/inputmethod/keyboard/PointerTracker.java
with
32 additions
and
36 deletions
java/src/com/android/inputmethod/keyboard/PointerTracker.java
+
32
−
36
View file @
2a3b15b2
...
...
@@ -971,44 +971,40 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
startRepeatKey
(
key
);
if
(
mIsAllowedSlidingKeyInput
)
{
processSlidingKeyInput
(
key
,
x
,
y
,
eventTime
);
}
else
{
// HACK: On some devices, quick successive touches may be reported as a sudden move by
// touch panel firmware. This hack detects such cases and translates the move event to
// successive up and down events.
// TODO: Should find a way to balance gesture detection and this hack.
if
(
sNeedsPhantomSuddenMoveEventHack
&&
getDistance
(
x
,
y
,
lastX
,
lastY
)
>=
mPhantonSuddenMoveThreshold
)
{
processPhantomSuddenMoveHack
(
key
,
x
,
y
,
eventTime
,
oldKey
,
lastX
,
lastY
);
}
// HACK: On some devices, quick successive proximate touches may be reported as a bogus
// down-move-up event by touch panel firmware. This hack detects such cases and breaks
// these events into separate up and down events.
else
if
(
sNeedsProximateBogusDownMoveUpEventHack
&&
sTimeRecorder
.
isInFastTyping
(
eventTime
)
&&
mBogusMoveEventDetector
.
isCloseToActualDownEvent
(
x
,
y
))
{
processProximateBogusDownMoveUpEventHack
(
key
,
x
,
y
,
eventTime
,
oldKey
,
lastX
,
lastY
);
}
// HACK: On some devices, quick successive touches may be reported as a sudden move by
// touch panel firmware. This hack detects such cases and translates the move event to
// successive up and down events.
// TODO: Should find a way to balance gesture detection and this hack.
else
if
(
sNeedsPhantomSuddenMoveEventHack
&&
getDistance
(
x
,
y
,
lastX
,
lastY
)
>=
mPhantonSuddenMoveThreshold
)
{
processPhantomSuddenMoveHack
(
key
,
x
,
y
,
eventTime
,
oldKey
,
lastX
,
lastY
);
}
// HACK: On some devices, quick successive proximate touches may be reported as a bogus
// down-move-up event by touch panel firmware. This hack detects such cases and breaks
// these events into separate up and down events.
else
if
(
sNeedsProximateBogusDownMoveUpEventHack
&&
sTimeRecorder
.
isInFastTyping
(
eventTime
)
&&
mBogusMoveEventDetector
.
isCloseToActualDownEvent
(
x
,
y
))
{
processProximateBogusDownMoveUpEventHack
(
key
,
x
,
y
,
eventTime
,
oldKey
,
lastX
,
lastY
);
}
// HACK: If there are currently multiple touches, register the key even if the finger
// slides off the key. This defends against noise from some touch panels when there are
// close multiple touches.
// Caveat: When in chording input mode with a modifier key, we don't use this hack.
else
if
(
getActivePointerTrackerCount
()
>
1
&&
sPointerTrackerQueue
!=
null
&&
!
sPointerTrackerQueue
.
hasModifierKeyOlderThan
(
this
))
{
if
(
DEBUG_MODE
)
{
Log
.
w
(
TAG
,
String
.
format
(
"[%d] onMoveEvent:"
+
" detected sliding finger while multi touching"
,
mPointerId
));
}
else
{
// HACK: If there are currently multiple touches, register the key even if the
// finger slides off the key. This defends against noise from some touch panels
// when there are close multiple touches.
// Caveat: When in chording input mode with a modifier key, we don't use this hack.
if
(
getActivePointerTrackerCount
()
>
1
&&
sPointerTrackerQueue
!=
null
&&
!
sPointerTrackerQueue
.
hasModifierKeyOlderThan
(
this
))
{
if
(
DEBUG_MODE
)
{
Log
.
w
(
TAG
,
String
.
format
(
"[%d] onMoveEvent:"
+
" detected sliding finger while multi touching"
,
mPointerId
));
}
onUpEvent
(
x
,
y
,
eventTime
);
mKeyAlreadyProcessed
=
true
;
setReleasedKeyGraphics
(
oldKey
);
}
else
{
if
(!
mIsDetectingGesture
)
{
mKeyAlreadyProcessed
=
true
;
}
setReleasedKeyGraphics
(
oldKey
);
}
onUpEvent
(
x
,
y
,
eventTime
);
mKeyAlreadyProcessed
=
true
;
setReleasedKeyGraphics
(
oldKey
);
}
else
{
if
(!
mIsDetectingGesture
)
{
mKeyAlreadyProcessed
=
true
;
}
setReleasedKeyGraphics
(
oldKey
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment