From 0a2872cb448c6df1009011414359981d411bd879 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 4 Aug 2014 22:28:24 +0900 Subject: [PATCH] [HW16] Implement processing event chains. Change-Id: I4e1e4f101050ebda77c629a61c548d3c8efb330f --- .../latin/inputlogic/InputLogic.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index 5c719edb9..97457b2f7 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -426,13 +426,17 @@ public final class InputLogic { cancelDoubleSpacePeriodCountdown(); } - if (processedEvent.isConsumed()) { - handleConsumedEvent(processedEvent, inputTransaction); - } else if (processedEvent.isFunctionalKeyEvent()) { - handleFunctionalEvent(processedEvent, inputTransaction, currentKeyboardScriptId, - handler); - } else { - handleNonFunctionalEvent(processedEvent, inputTransaction, handler); + Event currentEvent = processedEvent; + while (null != currentEvent) { + if (currentEvent.isConsumed()) { + handleConsumedEvent(currentEvent, inputTransaction); + } else if (currentEvent.isFunctionalKeyEvent()) { + handleFunctionalEvent(currentEvent, inputTransaction, currentKeyboardScriptId, + handler); + } else { + handleNonFunctionalEvent(currentEvent, inputTransaction, handler); + } + currentEvent = currentEvent.mNextEvent; } if (!inputTransaction.didAutoCorrect() && processedEvent.mKeyCode != Constants.CODE_SHIFT && processedEvent.mKeyCode != Constants.CODE_CAPSLOCK