aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-04-14 12:31:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-14 12:31:22 +0000
commit751dc070bf5cbf2534eb86f5dbc05ec38fcffbee (patch)
tree749b9414c8edc6c97a6a1b38d4257ffd8bafd467 /java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java
parentd4e54af0bad9cdee02756f4973fb48670005e31a (diff)
parent2282e8520a2c1984989a14fb09896536f5033b26 (diff)
downloadlatinime-751dc070bf5cbf2534eb86f5dbc05ec38fcffbee.tar.gz
latinime-751dc070bf5cbf2534eb86f5dbc05ec38fcffbee.tar.xz
latinime-751dc070bf5cbf2534eb86f5dbc05ec38fcffbee.zip
Merge "Fix updating the shift state upon backspace"
Diffstat (limited to 'java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java')
-rw-r--r--java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java b/java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java
index da6780e08..05ba99923 100644
--- a/java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java
+++ b/java/src/com/android/inputmethod/event/HardwareKeyboardEventDecoder.java
@@ -46,9 +46,10 @@ public class HardwareKeyboardEventDecoder implements HardwareEventDecoder {
// do not necessarily map to a unicode character. This represents a physical key, like
// the key for 'A' or Space, but also Backspace or Ctrl or Caps Lock.
final int keyCode = keyEvent.getKeyCode();
+ final boolean isKeyRepeat = (0 != keyEvent.getRepeatCount());
if (KeyEvent.KEYCODE_DEL == keyCode) {
return Event.createHardwareKeypressEvent(Event.NOT_A_CODE_POINT, Constants.CODE_DELETE,
- null /* next */);
+ null /* next */, isKeyRepeat);
}
if (keyEvent.isPrintingKey() || KeyEvent.KEYCODE_SPACE == keyCode
|| KeyEvent.KEYCODE_ENTER == keyCode) {
@@ -65,15 +66,16 @@ public class HardwareKeyboardEventDecoder implements HardwareEventDecoder {
// Latin IME decide what to do with it.
if (keyEvent.isShiftPressed()) {
return Event.createHardwareKeypressEvent(Event.NOT_A_CODE_POINT,
- Constants.CODE_SHIFT_ENTER, null /* next */);
+ Constants.CODE_SHIFT_ENTER, null /* next */, isKeyRepeat);
} else {
return Event.createHardwareKeypressEvent(Constants.CODE_ENTER, keyCode,
- null /* next */);
+ null /* next */, isKeyRepeat);
}
}
// If not Enter, then this is just a regular keypress event for a normal character
// that can be committed right away, taking into account the current state.
- return Event.createHardwareKeypressEvent(keyCode, codePointAndFlags, null /* next */);
+ return Event.createHardwareKeypressEvent(keyCode, codePointAndFlags, null /* next */,
+ isKeyRepeat);
}
return Event.createNotHandledEvent();
}