diff options
author | 2014-04-14 12:31:22 +0000 | |
---|---|---|
committer | 2014-04-14 12:31:22 +0000 | |
commit | 751dc070bf5cbf2534eb86f5dbc05ec38fcffbee (patch) | |
tree | 749b9414c8edc6c97a6a1b38d4257ffd8bafd467 /java/src/com/android/inputmethod/event/Event.java | |
parent | d4e54af0bad9cdee02756f4973fb48670005e31a (diff) | |
parent | 2282e8520a2c1984989a14fb09896536f5033b26 (diff) | |
download | latinime-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/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() { |