diff options
author | 2014-03-31 19:43:12 +0900 | |
---|---|---|
committer | 2014-04-14 21:28:24 +0900 | |
commit | 2282e8520a2c1984989a14fb09896536f5033b26 (patch) | |
tree | 3c6cab5a8453fd0be24b89cd5f261da2ffb3abf1 /java/src/com/android/inputmethod/event/Event.java | |
parent | 30d5ed67d6548a4d7efa6354d41ac9719a4e4488 (diff) | |
download | latinime-2282e8520a2c1984989a14fb09896536f5033b26.tar.gz latinime-2282e8520a2c1984989a14fb09896536f5033b26.tar.xz latinime-2282e8520a2c1984989a14fb09896536f5033b26.zip |
Fix updating the shift state upon backspace
Bug: 13514349
Change-Id: If4c9db12b0ab5be676f7a2f72715f469066ee537
Diffstat (limited to 'java/src/com/android/inputmethod/event/Event.java')
-rw-r--r-- | java/src/com/android/inputmethod/event/Event.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/event/Event.java b/java/src/com/android/inputmethod/event/Event.java index 6535d2d76..4a9163c8e 100644 --- a/java/src/com/android/inputmethod/event/Event.java +++ b/java/src/com/android/inputmethod/event/Event.java @@ -65,6 +65,8 @@ public class Event { // This event is a dead character, usually input by a dead key. Examples include dead-acute // or dead-abovering. final private static int FLAG_DEAD = 0x1; + // This event is coming from a key repeat, software or hardware. + final private static int FLAG_REPEAT = 0x2; final private int mEventType; // The type of event - one of the constants above // The code point associated with the event, if relevant. This is a unicode code point, and @@ -130,16 +132,16 @@ public class Event { } public static Event createSoftwareKeypressEvent(final int codePoint, final int keyCode, - final int x, final int y) { + final int x, final int y, final boolean isKeyRepeat) { return new Event(EVENT_TYPE_INPUT_KEYPRESS, null /* text */, codePoint, keyCode, x, y, - null /* suggestedWordInfo */, FLAG_NONE, null /* next */); + null /* suggestedWordInfo */, isKeyRepeat ? FLAG_REPEAT : FLAG_NONE, null); } public static Event createHardwareKeypressEvent(final int codePoint, final int keyCode, - final Event next) { + final Event next, final boolean isKeyRepeat) { return new Event(EVENT_TYPE_INPUT_KEYPRESS, null /* text */, codePoint, keyCode, Constants.EXTERNAL_KEYBOARD_COORDINATE, Constants.EXTERNAL_KEYBOARD_COORDINATE, - null /* suggestedWordInfo */, FLAG_NONE, next); + null /* suggestedWordInfo */, isKeyRepeat ? FLAG_REPEAT : FLAG_NONE, next); } // This creates an input event for a dead character. @see {@link #FLAG_DEAD} @@ -228,6 +230,10 @@ public class Event { return 0 != (FLAG_DEAD & mFlags); } + public boolean isKeyRepeat() { + return 0 != (FLAG_REPEAT & mFlags); + } + // Returns whether this is a fake key press from the suggestion strip. This happens with // punctuation signs selected from the suggestion strip. public boolean isSuggestionStripPress() { |