diff options
Diffstat (limited to 'java/src')
7 files changed, 185 insertions, 284 deletions
diff --git a/java/src/com/android/inputmethod/event/Event.java b/java/src/com/android/inputmethod/event/Event.java index ed487e13f..41bf36b36 100644 --- a/java/src/com/android/inputmethod/event/Event.java +++ b/java/src/com/android/inputmethod/event/Event.java @@ -168,4 +168,8 @@ public class Event { public boolean isCommittable() { return EVENT_INPUT_KEYPRESS == mType || EVENT_MODE_KEY == mType || EVENT_TOGGLE == mType; } + + public boolean isHandled() { + return EVENT_NOT_HANDLED != mType; + } } diff --git a/java/src/com/android/inputmethod/event/EventInterpreter.java b/java/src/com/android/inputmethod/event/EventInterpreter.java index 726b9206b..bcf10fc58 100644 --- a/java/src/com/android/inputmethod/event/EventInterpreter.java +++ b/java/src/com/android/inputmethod/event/EventInterpreter.java @@ -16,11 +16,6 @@ package com.android.inputmethod.event; -import android.util.SparseArray; -import android.view.KeyEvent; - -import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; @@ -37,25 +32,9 @@ public class EventInterpreter { // TODO: Implement an object pool for events, as we'll create a lot of them // TODO: Create a combiner // TODO: Create an object type to represent input material + visual feedback + decoding state - // TODO: Create an interface to call back to Latin IME through the above object - final EventDecoderSpec mDecoderSpec; - final SparseArray<HardwareEventDecoder> mHardwareEventDecoders; - final SoftwareEventDecoder mSoftwareEventDecoder; - final LatinIME mLatinIme; - final ArrayList<Combiner> mCombiners; - - /** - * Create a default interpreter. - * - * This creates a default interpreter that does nothing. A default interpreter should normally - * only be used for fallback purposes, when we really don't know what we want to do with input. - * - * @param latinIme a reference to the ime. - */ - public EventInterpreter(final LatinIME latinIme) { - this(null, latinIme); - } + private final EventDecoderSpec mDecoderSpec; + private final ArrayList<Combiner> mCombiners; /** * Create an event interpreter according to a specification. @@ -70,64 +49,10 @@ public class EventInterpreter { * interpreter that does no specific combining, and assumes the most common cases. * * @param specification the specification for event interpretation. null for default. - * @param latinIme a reference to the ime. */ - public EventInterpreter(final EventDecoderSpec specification, final LatinIME latinIme) { + public EventInterpreter(final EventDecoderSpec specification) { mDecoderSpec = null != specification ? specification : new EventDecoderSpec(); - // For both, we expect to have only one decoder in almost all cases, hence the default - // capacity of 1. - mHardwareEventDecoders = new SparseArray<HardwareEventDecoder>(1); - mSoftwareEventDecoder = new SoftwareKeyboardEventDecoder(); mCombiners = CollectionUtils.newArrayList(); mCombiners.add(new DeadKeyCombiner()); - mLatinIme = latinIme; - } - - // Helper method to decode a hardware key event into a generic event, and execute any - // necessary action. - public boolean onHardwareKeyEvent(final KeyEvent hardwareKeyEvent) { - final Event decodedEvent = getHardwareKeyEventDecoder(hardwareKeyEvent.getDeviceId()) - .decodeHardwareKey(hardwareKeyEvent); - return onEvent(decodedEvent); - } - - public boolean onSoftwareEvent() { - final Event decodedEvent = getSoftwareEventDecoder().decodeSoftwareEvent(); - return onEvent(decodedEvent); - } - - private HardwareEventDecoder getHardwareKeyEventDecoder(final int deviceId) { - final HardwareEventDecoder decoder = mHardwareEventDecoders.get(deviceId); - if (null != decoder) return decoder; - // TODO: create the decoder according to the specification - final HardwareEventDecoder newDecoder = new HardwareKeyboardEventDecoder(deviceId); - mHardwareEventDecoders.put(deviceId, newDecoder); - return newDecoder; - } - - private SoftwareEventDecoder getSoftwareEventDecoder() { - // Within the context of Latin IME, since we never present several software interfaces - // at the time, we should never need multiple software event decoders at a time. - return mSoftwareEventDecoder; - } - - private boolean onEvent(final Event event) { - Event currentlyProcessingEvent = event; - boolean processed = false; - for (int i = 0; i < mCombiners.size(); ++i) { - currentlyProcessingEvent = mCombiners.get(i).combine(event); - } - while (null != currentlyProcessingEvent) { - if (currentlyProcessingEvent.isCommittable()) { - mLatinIme.onCodeInput(currentlyProcessingEvent.mCodePoint, - Constants.EXTERNAL_KEYBOARD_COORDINATE, - Constants.EXTERNAL_KEYBOARD_COORDINATE); - processed = true; - } else if (event.isDead()) { - processed = true; - } - currentlyProcessingEvent = currentlyProcessingEvent.mNextEvent; - } - return processed; } } diff --git a/java/src/com/android/inputmethod/event/SoftwareEventDecoder.java b/java/src/com/android/inputmethod/event/SoftwareEventDecoder.java deleted file mode 100644 index d81ee0b37..000000000 --- a/java/src/com/android/inputmethod/event/SoftwareEventDecoder.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.event; - -/** - * An event decoder for events out of a software keyboard. - * - * This defines the interface for an event decoder that supports events out of a software keyboard. - * This differs significantly from hardware keyboard event decoders in several respects. First, - * a software keyboard does not have a scancode/layout system; the keypresses that insert - * characters output unicode characters directly. - */ -public interface SoftwareEventDecoder extends EventDecoder { - public Event decodeSoftwareEvent(); -} diff --git a/java/src/com/android/inputmethod/event/SoftwareKeyboardEventDecoder.java b/java/src/com/android/inputmethod/event/SoftwareKeyboardEventDecoder.java deleted file mode 100644 index de91567c7..000000000 --- a/java/src/com/android/inputmethod/event/SoftwareKeyboardEventDecoder.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.event; - -/** - * A decoder for events from software keyboard, like the ones displayed by Latin IME. - */ -public class SoftwareKeyboardEventDecoder implements SoftwareEventDecoder { - @Override - public Event decodeSoftwareEvent() { - return null; - } -} diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index 7a0161e65..e9ecd1e67 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -87,9 +87,9 @@ public final class KeyboardTextsTable { /* 5:23 */ "double_quotes", /* 6:22 */ "single_quotes", /* 7:21 */ "more_keys_for_c", - /* 8:20 */ "more_keys_for_s", - /* 9:20 */ "more_keys_for_n", - /* 10:20 */ "label_to_alpha_key", + /* 8:21 */ "label_to_alpha_key", + /* 9:20 */ "more_keys_for_s", + /* 10:20 */ "more_keys_for_n", /* 11:14 */ "more_keys_for_y", /* 12:13 */ "more_keys_for_d", /* 13:12 */ "more_keys_for_z", @@ -260,13 +260,11 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_lqm_rqm", /* single_quotes */ "!text/single_lqm_rqm", - /* more_keys_for_c ~ */ - EMPTY, EMPTY, EMPTY, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ EMPTY, // Label for "switch to alphabetic" key. /* label_to_alpha_key */ "ABC", - /* more_keys_for_y ~ */ - EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, + /* more_keys_for_s ~ */ + EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, /* ~ more_keys_for_g */ /* single_angle_quotes */ "!text/single_laqm_raqm", /* double_angle_quotes */ "!text/double_laqm_raqm", @@ -508,12 +506,11 @@ public final class KeyboardTextsTable { // U+0133: "ij" LATIN SMALL LIGATURE IJ /* more_keys_for_i */ "\u00ED,\u00EC,\u00EF,\u00EE,\u012F,\u012B,\u0133", /* double_quotes ~ */ - null, null, null, null, + null, null, null, null, null, /* ~ more_keys_for_s */ // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+0133: "ij" LATIN SMALL LIGATURE IJ /* more_keys_for_y */ "\u00FD,\u0133", @@ -522,17 +519,17 @@ public final class KeyboardTextsTable { /* Language ar: Arabic */ private static final String[] LANGUAGE_ar = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0623: "أ" ARABIC LETTER ALEF WITH HAMZA ABOVE // U+200C: ZERO WIDTH NON-JOINER // U+0628: "ب" ARABIC LETTER BEH // U+062C: "ج" ARABIC LETTER JEEM /* label_to_alpha_key */ "\u0623\u200C\u0628\u200C\u062C", - /* more_keys_for_y ~ */ + /* more_keys_for_s ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, + null, null, null, null, null, null, null, null, /* ~ more_keys_for_cyrillic_soft_sign */ /* more_keys_for_punctuation */ "!fixedColumnOrder!8,\",\',#,-,:,!,\u060C,\u061F,@,&,\\%,+,\u061B,/,(|),)|(", /* more_keys_for_nordic_row2_11 */ null, @@ -686,13 +683,14 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON /* more_keys_for_s */ "\u015F,\u00DF,\u015B,\u0161", /* more_keys_for_n ~ */ - null, null, null, null, null, null, null, + null, null, null, null, null, null, /* ~ more_keys_for_l */ // U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE /* more_keys_for_g */ "\u011F", @@ -705,16 +703,14 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", @@ -740,9 +736,8 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ // single_quotes of Bulgarian is default single_quotes_right_left. /* double_quotes */ "!text/double_9qm_lqm", - /* single_quotes ~ */ - null, null, null, null, - /* ~ more_keys_for_n */ + /* single_quotes */ null, + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE @@ -800,12 +795,13 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, /* more_keys_for_s */ null, // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key ~ */ - null, null, null, null, null, + /* more_keys_for_y ~ */ + null, null, null, null, /* ~ more_keys_for_t */ // U+00B7: "·" MIDDLE DOT // U+0142: "ł" LATIN SMALL LETTER L WITH STROKE @@ -880,6 +876,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u00E7,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -888,7 +885,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u0148,\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -940,6 +936,7 @@ public final class KeyboardTextsTable { /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", /* more_keys_for_c */ null, + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON @@ -947,7 +944,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -1014,6 +1010,7 @@ public final class KeyboardTextsTable { /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", /* more_keys_for_c */ null, + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON @@ -1021,8 +1018,8 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key ~ */ - null, null, null, null, null, null, null, + /* more_keys_for_y ~ */ + null, null, null, null, null, null, /* ~ more_keys_for_g */ /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", @@ -1050,8 +1047,8 @@ public final class KeyboardTextsTable { /* Language el: Greek */ private static final String[] LANGUAGE_el = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0391: "Α" GREEK CAPITAL LETTER ALPHA // U+0392: "Β" GREEK CAPITAL LETTER BETA @@ -1101,6 +1098,7 @@ public final class KeyboardTextsTable { /* single_quotes */ null, // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA /* more_keys_for_c */ "\u00E7", + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S /* more_keys_for_s */ "\u00DF", // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE @@ -1169,6 +1167,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE /* more_keys_for_c */ "\u0107,\u010D,\u00E7,\u010B", + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -1182,7 +1181,6 @@ public final class KeyboardTextsTable { // U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE // U+014B: "ŋ" LATIN SMALL LETTER ENG /* more_keys_for_n */ "\u00F1,\u0144,\u0146,\u0148,\u0149,\u014B", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -1309,13 +1307,14 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, /* more_keys_for_s */ null, // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key ~ */ + /* more_keys_for_y ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, + null, null, null, null, null, null, /* ~ more_keys_for_cyrillic_soft_sign */ // U+00A1: "¡" INVERTED EXCLAMATION MARK // U+00BF: "¿" INVERTED QUESTION MARK @@ -1375,6 +1374,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u00E7,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -1384,7 +1384,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u0146,\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -1428,16 +1427,16 @@ public final class KeyboardTextsTable { /* Language fa: Persian */ private static final String[] LANGUAGE_fa = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0627: "ا" ARABIC LETTER ALEF // U+200C: ZERO WIDTH NON-JOINER // U+0628: "ب" ARABIC LETTER BEH // U+067E: "پ" ARABIC LETTER PEH /* label_to_alpha_key */ "\u0627\u200C\u0628\u200C\u067E", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+FDFC: "﷼" RIAL SIGN /* keylabel_for_currency */ "\uFDFC", @@ -1591,14 +1590,14 @@ public final class KeyboardTextsTable { // U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS /* more_keys_for_u */ "\u00FC", /* more_keys_for_e ~ */ - null, null, null, null, null, - /* ~ more_keys_for_c */ + null, null, null, null, null, null, + /* ~ label_to_alpha_key */ // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE /* more_keys_for_s */ "\u0161,\u00DF,\u015B", /* more_keys_for_n ~ */ - null, null, null, null, + null, null, null, /* ~ more_keys_for_d */ // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE @@ -1671,9 +1670,9 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", - /* more_keys_for_s ~ */ + /* label_to_alpha_key ~ */ null, null, null, - /* ~ label_to_alpha_key */ + /* ~ more_keys_for_n */ // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "%,\u00FF", /* more_keys_for_d ~ */ @@ -1700,15 +1699,15 @@ public final class KeyboardTextsTable { /* Language hi: Hindi */ private static final String[] LANGUAGE_hi = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0915: "क" DEVANAGARI LETTER KA // U+0916: "ख" DEVANAGARI LETTER KHA // U+0917: "ग" DEVANAGARI LETTER GA /* label_to_alpha_key */ "\u0915\u0916\u0917", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+20B9: "₹" INDIAN RUPEE SIGN /* keylabel_for_currency */ "\u20B9", @@ -1763,6 +1762,7 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA /* more_keys_for_c */ "\u010D,\u0107,\u00E7", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+00DF: "ß" LATIN SMALL LETTER SHARP S @@ -1770,7 +1770,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key */ null, /* more_keys_for_y */ null, // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* more_keys_for_d */ "\u0111", @@ -1840,16 +1839,16 @@ public final class KeyboardTextsTable { /* Language hy_AM: Armenian (Armenia) */ private static final String[] LANGUAGE_hy_AM = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0531: "Ա" ARMENIAN CAPITAL LETTER AYB // U+0532: "Բ" ARMENIAN CAPITAL LETTER BEN // U+0533: "Գ" ARMENIAN CAPITAL LETTER GIM /* label_to_alpha_key */ "\u0531\u0532\u0533", - /* more_keys_for_y ~ */ + /* more_keys_for_s ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, + null, null, null, null, null, null, null, null, /* ~ more_keys_for_cyrillic_soft_sign */ // U+058A: "֊" ARMENIAN HYPHEN // U+055C: "՜" ARMENIAN EXCLAMATION MARK @@ -1933,7 +1932,7 @@ public final class KeyboardTextsTable { /* single_quotes */ "!text/single_9qm_lqm", /* more_keys_for_c ~ */ null, null, null, null, - /* ~ label_to_alpha_key */ + /* ~ more_keys_for_n */ // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -1996,16 +1995,14 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_rqm_9qm", /* single_quotes */ "!text/single_rqm_9qm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+05D0: "א" HEBREW LETTER ALEF // U+05D1: "ב" HEBREW LETTER BET // U+05D2: "ג" HEBREW LETTER GIMEL /* label_to_alpha_key */ "\u05D0\u05D1\u05D2", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+20AA: "₪" NEW SHEQEL SIGN /* keylabel_for_currency */ "\u20AA", @@ -2055,9 +2052,7 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+10D0: "ა" GEORGIAN LETTER AN // U+10D1: "ბ" GEORGIAN LETTER BAN @@ -2068,15 +2063,15 @@ public final class KeyboardTextsTable { /* Language kk: Kazakh */ private static final String[] LANGUAGE_kk = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", @@ -2124,21 +2119,21 @@ public final class KeyboardTextsTable { /* Language km_KH: Khmer (Cambodia) */ private static final String[] LANGUAGE_km_KH = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+1780: "ក" KHMER LETTER KA // U+1781: "ខ" KHMER LETTER KHA // U+1782: "គ" KHMER LETTER KO /* label_to_alpha_key */ "\u1780\u1781\u1782", - /* more_keys_for_y ~ */ + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_east_slavic_row2_11 */ // U+17DB: "៛" KHMER CURRENCY SYMBOL RIEL /* more_keys_for_currency_dollar */ "\u17DB,\u00A2,\u00A3,\u20AC,\u00A5,\u20B1", @@ -2147,15 +2142,15 @@ public final class KeyboardTextsTable { /* Language ky: Kirghiz */ private static final String[] LANGUAGE_ky = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", @@ -2190,15 +2185,15 @@ public final class KeyboardTextsTable { /* Language lo_LA: Lao (Laos) */ private static final String[] LANGUAGE_lo_LA = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0E81: "ກ" LAO LETTER KO // U+0E82: "ຂ" LAO LETTER KHO SUNG // U+0E84: "ຄ" LAO LETTER KHO TAM /* label_to_alpha_key */ "\u0E81\u0E82\u0E84", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+20AD: "₭" KIP SIGN /* keylabel_for_currency */ "\u20AD", @@ -2258,6 +2253,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u00E7,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -2267,7 +2263,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u0146,\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -2352,6 +2347,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u00E7,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -2361,7 +2357,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u0146,\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -2400,16 +2395,14 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_k */ // U+0450: "ѐ" CYRILLIC SMALL LETTER IE WITH GRAVE /* more_keys_for_cyrillic_ie */ "\u0450", @@ -2434,20 +2427,32 @@ public final class KeyboardTextsTable { /* Language mn_MN: Mongolian (Mongolia) */ private static final String[] LANGUAGE_mn_MN = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+20AE: "₮" TUGRIK SIGN /* keylabel_for_currency */ "\u20AE", }; + /* Language my_MM: Burmese (Myanmar) */ + private static final String[] LANGUAGE_my_MM = { + /* more_keys_for_a ~ */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ + // Label for "switch to alphabetic" key. + // U+1000: "က" MYANMAR LETTER KA + // U+1001: "ခ" MYANMAR LETTER KHA + // U+1002: "ဂ" MYANMAR LETTER GA + /* label_to_alpha_key */ "\u1000\u1001\u1002", + }; + /* Language nb: Norwegian Bokmål */ private static final String[] LANGUAGE_nb = { // U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE @@ -2504,15 +2509,15 @@ public final class KeyboardTextsTable { /* Language ne_NP: Nepali (Nepal) */ private static final String[] LANGUAGE_ne_NP = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0915: "क" DEVANAGARI LETTER KA // U+0916: "ख" DEVANAGARI LETTER KHA // U+0917: "ग" DEVANAGARI LETTER GA /* label_to_alpha_key */ "\u0915\u0916\u0917", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN /* keylabel_for_currency */ "\u0930\u0941.", @@ -2600,12 +2605,12 @@ public final class KeyboardTextsTable { /* more_keys_for_i */ "\u00ED,\u00EF,\u00EC,\u00EE,\u012F,\u012B,\u0133", /* double_quotes */ "!text/double_9qm_rqm", /* single_quotes */ "!text/single_9qm_rqm", - /* more_keys_for_c */ null, - /* more_keys_for_s */ null, + /* more_keys_for_c ~ */ + null, null, null, + /* ~ more_keys_for_s */ // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+0133: "ij" LATIN SMALL LIGATURE IJ /* more_keys_for_y */ "\u0133", }; @@ -2647,6 +2652,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u0107,\u00E7,\u010D", + /* label_to_alpha_key */ null, // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+0161: "š" LATIN SMALL LETTER S WITH CARON @@ -2654,9 +2660,8 @@ public final class KeyboardTextsTable { // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE /* more_keys_for_n */ "\u0144,\u00F1", - /* label_to_alpha_key ~ */ - null, null, null, - /* ~ more_keys_for_d */ + /* more_keys_for_y */ null, + /* more_keys_for_d */ null, // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON @@ -2754,13 +2759,14 @@ public final class KeyboardTextsTable { /* double_quotes */ "!text/double_9qm_rqm", /* single_quotes */ "!text/single_9qm_rqm", /* more_keys_for_c */ null, + /* label_to_alpha_key */ null, // U+0219: "ș" LATIN SMALL LETTER S WITH COMMA BELOW // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON /* more_keys_for_s */ "\u0219,\u00DF,\u015B,\u0161", /* more_keys_for_n ~ */ - null, null, null, null, null, + null, null, null, null, /* ~ more_keys_for_z */ // U+021B: "ț" LATIN SMALL LETTER T WITH COMMA BELOW /* more_keys_for_t */ "\u021B", @@ -2773,16 +2779,14 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ more_keys_for_k */ // U+0451: "ё" CYRILLIC SMALL LETTER IO /* more_keys_for_cyrillic_ie */ "\u0451", @@ -2854,6 +2858,7 @@ public final class KeyboardTextsTable { // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u00E7,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE @@ -2864,7 +2869,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE /* more_keys_for_n */ "\u0148,\u0146,\u00F1,\u0144", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -2906,11 +2910,11 @@ public final class KeyboardTextsTable { // U+010D: "č" LATIN SMALL LETTER C WITH CARON // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE /* more_keys_for_c */ "\u010D,\u0107", + /* label_to_alpha_key */ null, // U+0161: "š" LATIN SMALL LETTER S WITH CARON /* more_keys_for_s */ "\u0161", - /* more_keys_for_n ~ */ - null, null, null, - /* ~ more_keys_for_y */ + /* more_keys_for_n */ null, + /* more_keys_for_y */ null, // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* more_keys_for_d */ "\u0111", // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON @@ -2929,17 +2933,15 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // END: More keys definitions for Serbian (Cyrillic) // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, /* ~ more_keys_for_g */ /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", @@ -3021,6 +3023,7 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA @@ -3030,7 +3033,6 @@ public final class KeyboardTextsTable { // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0148: "ň" LATIN SMALL LETTER N WITH CARON /* more_keys_for_n */ "\u0144,\u00F1,\u0148", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS /* more_keys_for_y */ "\u00FD,\u00FF", @@ -3113,12 +3115,13 @@ public final class KeyboardTextsTable { /* single_quotes */ null, // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA /* more_keys_for_c */ "\u00E7", + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S /* more_keys_for_s */ "\u00DF", // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE /* more_keys_for_n */ "\u00F1", - /* label_to_alpha_key ~ */ - null, null, null, null, null, null, + /* more_keys_for_y ~ */ + null, null, null, null, null, /* ~ more_keys_for_l */ /* more_keys_for_g */ "g\'", }; @@ -3126,15 +3129,15 @@ public final class KeyboardTextsTable { /* Language th: Thai */ private static final String[] LANGUAGE_th = { /* more_keys_for_a ~ */ - null, null, null, null, null, null, null, null, null, null, - /* ~ more_keys_for_n */ + null, null, null, null, null, null, null, null, + /* ~ more_keys_for_c */ // Label for "switch to alphabetic" key. // U+0E01: "ก" THAI CHARACTER KO KAI // U+0E02: "ข" THAI CHARACTER KHO KHAI // U+0E04: "ค" THAI CHARACTER KHO KHWAI /* label_to_alpha_key */ "\u0E01\u0E02\u0E04", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+0E3F: "฿" THAI CURRENCY SYMBOL BAHT /* keylabel_for_currency */ "\u0E3F", @@ -3190,6 +3193,7 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, /* more_keys_for_s */ null, // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE // U+0144: "ń" LATIN SMALL LETTER N WITH ACUTE @@ -3230,13 +3234,14 @@ public final class KeyboardTextsTable { // U+0107: "ć" LATIN SMALL LETTER C WITH ACUTE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u010D", + /* label_to_alpha_key */ null, // U+015F: "ş" LATIN SMALL LETTER S WITH CEDILLA // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+0161: "š" LATIN SMALL LETTER S WITH CARON /* more_keys_for_s */ "\u015F,\u00DF,\u015B,\u0161", /* more_keys_for_n ~ */ - null, null, null, null, null, null, null, + null, null, null, null, null, null, /* ~ more_keys_for_l */ // U+011F: "ğ" LATIN SMALL LETTER G WITH BREVE /* more_keys_for_g */ "\u011F", @@ -3249,16 +3254,14 @@ public final class KeyboardTextsTable { /* ~ more_keys_for_i */ /* double_quotes */ "!text/double_9qm_lqm", /* single_quotes */ "!text/single_9qm_lqm", - /* more_keys_for_c ~ */ - null, null, null, - /* ~ more_keys_for_n */ + /* more_keys_for_c */ null, // Label for "switch to alphabetic" key. // U+0410: "А" CYRILLIC CAPITAL LETTER A // U+0411: "Б" CYRILLIC CAPITAL LETTER BE // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* label_to_alpha_key */ "\u0410\u0411\u0412", - /* more_keys_for_y ~ */ - null, null, null, null, null, null, null, null, + /* more_keys_for_s ~ */ + null, null, null, null, null, null, null, null, null, null, /* ~ double_angle_quotes */ // U+20B4: "₴" HRYVNIA SIGN /* keylabel_for_currency */ "\u20B4", @@ -3357,7 +3360,7 @@ public final class KeyboardTextsTable { /* more_keys_for_i */ "\u00EC,\u00ED,\u1EC9,\u0129,\u1ECB", /* double_quotes ~ */ null, null, null, null, null, null, - /* ~ label_to_alpha_key */ + /* ~ more_keys_for_n */ // U+1EF3: "ỳ" LATIN SMALL LETTER Y WITH GRAVE // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+1EF7: "ỷ" LATIN SMALL LETTER Y WITH HOOK ABOVE @@ -3416,6 +3419,7 @@ public final class KeyboardTextsTable { /* single_quotes */ null, // U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA /* more_keys_for_c */ "\u00E7", + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S /* more_keys_for_s */ "\u00DF", // U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE @@ -3488,6 +3492,7 @@ public final class KeyboardTextsTable { // U+010B: "ċ" LATIN SMALL LETTER C WITH DOT ABOVE // U+010D: "č" LATIN SMALL LETTER C WITH CARON /* more_keys_for_c */ "\u00E7,\u0107,\u0109,\u010B,\u010D", + /* label_to_alpha_key */ null, // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE // U+015D: "ŝ" LATIN SMALL LETTER S WITH CIRCUMFLEX @@ -3502,7 +3507,6 @@ public final class KeyboardTextsTable { // U+0149: "ʼn" LATIN SMALL LETTER N PRECEDED BY APOSTROPHE // U+014B: "ŋ" LATIN SMALL LETTER ENG /* more_keys_for_n */ "\u00F1,\u0144,\u0146,\u0148,\u0149,\u014B", - /* label_to_alpha_key */ null, // U+00FD: "ý" LATIN SMALL LETTER Y WITH ACUTE // U+0177: "ŷ" LATIN SMALL LETTER Y WITH CIRCUMFLEX // U+00FF: "ÿ" LATIN SMALL LETTER Y WITH DIAERESIS @@ -3570,13 +3574,13 @@ public final class KeyboardTextsTable { "ar", LANGUAGE_ar, /* 58/109 Arabic */ "az", LANGUAGE_az_AZ, /* 8/ 17 Azerbaijani (Azerbaijan) */ "be", LANGUAGE_be_BY, /* 9/ 32 Belarusian (Belarus) */ - "bg", LANGUAGE_bg, /* 2/ 11 Bulgarian */ + "bg", LANGUAGE_bg, /* 2/ 9 Bulgarian */ "ca", LANGUAGE_ca, /* 11/116 Catalan */ "cs", LANGUAGE_cs, /* 17/ 21 Czech */ "da", LANGUAGE_da, /* 19/ 34 Danish */ "de", LANGUAGE_de, /* 16/ 92 German */ - "el", LANGUAGE_el, /* 1/ 11 Greek */ - "en", LANGUAGE_en, /* 8/ 10 English */ + "el", LANGUAGE_el, /* 1/ 9 Greek */ + "en", LANGUAGE_en, /* 8/ 11 English */ "eo", LANGUAGE_eo, /* 26/128 Esperanto */ "es", LANGUAGE_es, /* 8/ 33 Spanish */ "et", LANGUAGE_et_EE, /* 22/ 27 Estonian (Estonia) */ @@ -3590,7 +3594,7 @@ public final class KeyboardTextsTable { "is", LANGUAGE_is, /* 10/ 15 Icelandic */ "it", LANGUAGE_it, /* 5/ 5 Italian */ "iw", LANGUAGE_iw, /* 20/117 Hebrew */ - "ka", LANGUAGE_ka_GE, /* 3/ 11 Georgian (Georgia) */ + "ka", LANGUAGE_ka_GE, /* 3/ 9 Georgian (Georgia) */ "kk", LANGUAGE_kk, /* 15/114 Kazakh */ "km", LANGUAGE_km_KH, /* 2/115 Khmer (Cambodia) */ "ky", LANGUAGE_ky, /* 10/ 81 Kirghiz */ @@ -3599,6 +3603,7 @@ public final class KeyboardTextsTable { "lv", LANGUAGE_lv, /* 18/ 22 Latvian */ "mk", LANGUAGE_mk, /* 9/ 86 Macedonian */ "mn", LANGUAGE_mn_MN, /* 2/ 20 Mongolian (Mongolia) */ + "my", LANGUAGE_my_MM, /* 1/ 9 Burmese (Myanmar) */ "nb", LANGUAGE_nb, /* 11/ 34 Norwegian Bokmål */ "ne", LANGUAGE_ne_NP, /* 24/ 56 Nepali (Nepal) */ "nl", LANGUAGE_nl, /* 9/ 12 Dutch */ @@ -3613,11 +3618,11 @@ public final class KeyboardTextsTable { "sv", LANGUAGE_sv, /* 21/ 34 Swedish */ "sw", LANGUAGE_sw, /* 9/ 17 Swahili */ "th", LANGUAGE_th, /* 2/ 20 Thai */ - "tl", LANGUAGE_tl, /* 7/ 10 Tagalog */ + "tl", LANGUAGE_tl, /* 7/ 11 Tagalog */ "tr", LANGUAGE_tr, /* 7/ 17 Turkish */ "uk", LANGUAGE_uk, /* 11/ 80 Ukrainian */ "vi", LANGUAGE_vi, /* 8/ 20 Vietnamese */ - "zu", LANGUAGE_zu, /* 8/ 10 Zulu */ + "zu", LANGUAGE_zu, /* 8/ 11 Zulu */ "zz", LANGUAGE_zz, /* 19/111 Alphabet */ }; diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 222e73529..4a18c2b3c 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -45,6 +45,7 @@ import android.text.TextUtils; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Printer; +import android.util.SparseArray; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup.LayoutParams; @@ -60,6 +61,8 @@ import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.compat.InputMethodServiceCompatUtils; import com.android.inputmethod.dictionarypack.DictionaryPackConstants; import com.android.inputmethod.event.Event; +import com.android.inputmethod.event.HardwareEventDecoder; +import com.android.inputmethod.event.HardwareKeyboardEventDecoder; import com.android.inputmethod.event.InputTransaction; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardActionListener; @@ -120,6 +123,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private final Settings mSettings; private final InputLogic mInputLogic = new InputLogic(this /* LatinIME */, this /* SuggestionStripViewAccessor */); + // We expect to have only one decoder in almost all cases, hence the default capacity of 1. + // If it turns out we need several, it will get grown seamlessly. + final SparseArray<HardwareEventDecoder> mHardwareEventDecoders + = new SparseArray<HardwareEventDecoder>(1); private View mExtractArea; private View mKeyPreviewBackingView; @@ -643,9 +650,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().initDictionary(newSuggest.mDictionaryFacilitator); } - final Suggest oldSuggest = mInputLogic.mSuggest; - mInputLogic.mSuggest = newSuggest; - if (oldSuggest != null) oldSuggest.close(); + mInputLogic.replaceSuggest(newSuggest); refreshPersonalizationDictionarySession(); } @@ -1588,19 +1593,31 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } + private HardwareEventDecoder getHardwareKeyEventDecoder(final int deviceId) { + final HardwareEventDecoder decoder = mHardwareEventDecoders.get(deviceId); + if (null != decoder) return decoder; + // TODO: create the decoder according to the specification + final HardwareEventDecoder newDecoder = new HardwareKeyboardEventDecoder(deviceId); + mHardwareEventDecoders.put(deviceId, newDecoder); + return newDecoder; + } + // Hooks for hardware keyboard @Override - public boolean onKeyDown(final int keyCode, final KeyEvent event) { - if (!ProductionFlag.IS_HARDWARE_KEYBOARD_SUPPORTED) return super.onKeyDown(keyCode, event); - // onHardwareKeyEvent, like onKeyDown returns true if it handled the event, false if - // it doesn't know what to do with it and leave it to the application. For example, - // hardware key events for adjusting the screen's brightness are passed as is. - if (mInputLogic.mEventInterpreter.onHardwareKeyEvent(event)) { - final long keyIdentifier = event.getDeviceId() << 32 + event.getKeyCode(); - mInputLogic.mCurrentlyPressedHardwareKeys.add(keyIdentifier); + public boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) { + if (!ProductionFlag.IS_HARDWARE_KEYBOARD_SUPPORTED) { + return super.onKeyDown(keyCode, keyEvent); + } + final Event event = getHardwareKeyEventDecoder( + keyEvent.getDeviceId()).decodeHardwareKey(keyEvent); + // If the event is not handled by LatinIME, we just pass it to the parent implementation. + // If it's handled, we return true because we did handle it. + if (event.isHandled()) { + mInputLogic.onCodeInput(mSettings.getCurrent(), event, + mKeyboardSwitcher.getKeyboardShiftMode(), mHandler); return true; } - return super.onKeyDown(keyCode, event); + return super.onKeyDown(keyCode, keyEvent); } @Override diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index cb55aa06c..fa7c4b4fc 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -80,8 +80,6 @@ public final class InputLogic { public SuggestedWords mSuggestedWords = SuggestedWords.EMPTY; // TODO: mSuggest should be touched by a single thread. public volatile Suggest mSuggest; - // The event interpreter should never be null. - public final EventInterpreter mEventInterpreter; public LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; public final WordComposer mWordComposer; @@ -104,11 +102,19 @@ public final class InputLogic { mLatinIME = latinIME; mSuggestionStripViewAccessor = suggestionStripViewAccessor; mWordComposer = new WordComposer(); - mEventInterpreter = new EventInterpreter(latinIME); mConnection = new RichInputConnection(latinIME); mInputLogicHandler = InputLogicHandler.NULL_HANDLER; } + // Replace the old Suggest with the passed Suggest and close it. + public void replaceSuggest(final Suggest newSuggest) { + final Suggest oldSuggest = mSuggest; + mSuggest = newSuggest; + if (oldSuggest != null) { + oldSuggest.close(); + } + } + /** * Initializes the input logic for input in an editor. * |