aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-08-04 04:09:54 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-04 04:09:54 +0000
commitd9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2 (patch)
tree42ced7a4554655ce9f07792b61c0812897643570 /java/src/com/android/inputmethod/event/DeadKeyCombiner.java
parent9681027aade82febb2ba5e384d9c6f77511859d3 (diff)
parent85b7b967b70393815da78aa4bae1938dbf9bbe1a (diff)
downloadlatinime-d9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2.tar.gz
latinime-d9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2.tar.xz
latinime-d9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2.zip
am 85b7b967: Merge "[HW12] Use the consumed status of the Event." into lmp-dev
* commit '85b7b967b70393815da78aa4bae1938dbf9bbe1a': [HW12] Use the consumed status of the Event.
Diffstat (limited to 'java/src/com/android/inputmethod/event/DeadKeyCombiner.java')
-rw-r--r--java/src/com/android/inputmethod/event/DeadKeyCombiner.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
index d816247d8..4f3f4d25f 100644
--- a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
+++ b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java
@@ -36,10 +36,16 @@ public class DeadKeyCombiner implements Combiner {
@Nonnull
public Event processEvent(final ArrayList<Event> previousEvents, final Event event) {
if (TextUtils.isEmpty(mDeadSequence)) {
+ // No dead char is currently being tracked: this is the most common case.
if (event.isDead()) {
+ // The event was a dead key. Start tracking it.
mDeadSequence.appendCodePoint(event.mCodePoint);
+ return Event.createConsumedEvent(event);
}
- return Event.createConsumedEvent(event);
+ // Regular keystroke when not keeping track of a dead key. Simply said, there are
+ // no dead keys at all in the current input, so this combiner has nothing to do and
+ // simply returns the event as is. The majority of events will go through this path.
+ return event;
} else {
// TODO: Allow combining for several dead chars rather than only the first one.
// The framework doesn't know how to do this now.