diff options
Diffstat (limited to 'java')
23 files changed, 147 insertions, 114 deletions
diff --git a/java/res/raw/main_es.dict b/java/res/raw/main_es.dict Binary files differindex fe24cd624..83eefe4f6 100644 --- a/java/res/raw/main_es.dict +++ b/java/res/raw/main_es.dict diff --git a/java/res/xml-sw600dp/key_comma.xml b/java/res/xml-sw600dp/key_comma.xml new file mode 100644 index 000000000..67199e237 --- /dev/null +++ b/java/res/xml-sw600dp/key_comma.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2014, 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. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <!-- The table comma key which may have settings as popup key. --> + <!-- Kept as a separate file for cleaner overriding by an overlay. --> + <key-style + latin:styleName="baseTabletCommaKeyStyle" + latin:keySpec="!text/keyspec_tablet_comma" + latin:keyHintLabel="!text/keyhintlabel_tablet_comma" + latin:keyLabelFlags="hasPopupHint" + latin:parentStyle="hasShiftedLetterHintStyle" /> + <switch> + <case + latin:clobberSettingsKey="true" + > + <Key + latin:moreKeys="!text/morekeys_tablet_comma" + latin:keyStyle="baseTabletCommaKeyStyle" /> + </case> + <!-- clobberSettingsKey="false" --> + <default> + <Key + latin:moreKeys="!text/morekeys_tablet_comma,!text/keyspec_settings" + latin:keyStyle="baseTabletCommaKeyStyle" /> + </default> + </switch> +</merge> diff --git a/java/res/xml-sw600dp/keys_comma_period.xml b/java/res/xml-sw600dp/key_period.xml index 23172cf18..d2909d82d 100644 --- a/java/res/xml-sw600dp/keys_comma_period.xml +++ b/java/res/xml-sw600dp/key_period.xml @@ -2,7 +2,7 @@ <!-- /* ** -** Copyright 2013, The Android Open Source Project +** Copyright 2014, 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. @@ -21,13 +21,8 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > - <Key - latin:keySpec="!text/keyspec_tablet_comma" - latin:keyHintLabel="!text/keyhintlabel_tablet_comma" - latin:keyLabelFlags="hasPopupHint" - latin:moreKeys="!text/morekeys_tablet_comma" - latin:backgroundType="functional" - latin:keyStyle="hasShiftedLetterHintStyle" /> + <!-- The table period key which may have different label depending on locale --> + <!-- Kept as a separate file for cleaner overriding by an overlay. --> <switch> <case latin:languageCode="hi" diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index c5506b5ab..7de276901 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -35,6 +35,9 @@ latin:keyLabelFlags="hasShiftedLetterHint" /> </default> </switch> + <!-- Base key style for the key which may have settings key as more keys. --> + <include + latin:keyboardLayout="@xml/key_styles_settings" /> <!-- Functional key styles --> <!-- Base style for shift key. A single space is used for dummy label in moreKeys. --> <key-style diff --git a/java/res/xml-sw600dp/row_dvorak4.xml b/java/res/xml-sw600dp/row_dvorak4.xml index d3709ef6d..ab2b5603d 100644 --- a/java/res/xml-sw600dp/row_dvorak4.xml +++ b/java/res/xml-sw600dp/row_dvorak4.xml @@ -30,19 +30,19 @@ latin:keyWidth="10.0%p" /> <include latin:keyboardLayout="@xml/key_settings" /> - <include - latin:keyboardLayout="@xml/key_f1" /> + <Key + latin:keySpec="_" + latin:keyHintLabel="-" + latin:moreKeys="-" + latin:keyStyle="hasShiftedLetterHintStyle" /> <include latin:keyXPos="28.0%p" latin:keyboardLayout="@xml/key_space_5kw" latin:backgroundType="normal" /> <include + latin:keyboardLayout="@xml/key_f1" /> + <include latin:keyboardLayout="@xml/key_question_exclamation" /> - <Key - latin:keySpec="-" - latin:keyHintLabel="_" - latin:moreKeys="_" - latin:keyStyle="hasShiftedLetterHintStyle" /> <include latin:keyboardLayout="@xml/key_f2" /> </Row> diff --git a/java/res/xml-sw600dp/row_qwerty4.xml b/java/res/xml-sw600dp/row_qwerty4.xml index d93143761..0eb86f2d4 100644 --- a/java/res/xml-sw600dp/row_qwerty4.xml +++ b/java/res/xml-sw600dp/row_qwerty4.xml @@ -29,15 +29,18 @@ latin:keyStyle="toSymbolKeyStyle" latin:keyWidth="10.0%p" /> <include - latin:keyboardLayout="@xml/key_settings" /> - <include - latin:keyboardLayout="@xml/key_f1" /> + latin:keyboardLayout="@xml/key_comma" /> + <Key + latin:keySpec="_" /> + <!-- Space key. --> <include latin:keyXPos="28.0%p" latin:keyboardLayout="@xml/key_space_5kw" latin:backgroundType="normal" /> <include - latin:keyboardLayout="@xml/keys_comma_period" /> + latin:keyboardLayout="@xml/key_f1" /> + <include + latin:keyboardLayout="@xml/key_period" /> <include latin:keyboardLayout="@xml/key_f2" /> </Row> diff --git a/java/res/xml/key_f1.xml b/java/res/xml/key_f1.xml index 3471c85f5..7bd7385a1 100644 --- a/java/res/xml/key_f1.xml +++ b/java/res/xml/key_f1.xml @@ -27,20 +27,20 @@ > <Key latin:keySpec="/" - latin:keyStyle="f1MoreKeysStyle" /> + latin:keyStyle="settingsMoreKeysStyle" /> </case> <case latin:mode="email" > <Key latin:keySpec="\@" - latin:keyStyle="f1MoreKeysStyle" /> + latin:keyStyle="settingsMoreKeysStyle" /> </case> <default> <Key latin:keySpec="!text/keyspec_comma" latin:keyLabelFlags="hasPopupHint" - latin:keyStyle="f1MoreKeysStyle" /> + latin:keyStyle="settingsMoreKeysStyle" /> </default> </switch> </merge> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 9d5d52e16..8b3bb2e5c 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -35,9 +35,9 @@ latin:keyLabelFlags="hasShiftedLetterHint" /> </default> </switch> - <!-- Base key style for the key which may have settings or tab key as popup key. --> + <!-- Base key style for the key which may have settings key as more keys. --> <include - latin:keyboardLayout="@xml/key_styles_f1" /> + latin:keyboardLayout="@xml/key_styles_settings" /> <!-- Functional key styles --> <!-- Base style for shift key. A single space is used for dummy label in moreKeys. --> <key-style @@ -104,7 +104,7 @@ latin:keyIconDisabled="!icon/shortcut_key_disabled" latin:keyActionFlags="noKeyPreview|altCodeWhileTyping" latin:altCode="!code/key_space" - latin:parentStyle="f1MoreKeysStyle" /> + latin:parentStyle="settingsMoreKeysStyle" /> <key-style latin:styleName="settingsKeyStyle" latin:keySpec="!icon/settings_key|!code/key_settings" diff --git a/java/res/xml/keys_less_greater.xml b/java/res/xml/key_styles_less_greater.xml index 778de02a1..db4c7984b 100644 --- a/java/res/xml/keys_less_greater.xml +++ b/java/res/xml/key_styles_less_greater.xml @@ -21,25 +21,31 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > + <!-- The less and greater keys' style which may have different label depending on locale. --> + <!-- Kept as a separate file for cleaner overriding by an overlay. --> <switch> <case latin:languageCode="fa" > - <Key + <key-style + latin:styleName="lessKeyStyle" latin:keySpec="!text/keyspec_left_double_angle_quote" latin:backgroundType="functional" latin:moreKeys="!text/morekeys_less_than" /> - <Key + <key-style + latin:styleName="greaterKeyStyle" latin:keySpec="!text/keyspec_right_double_angle_quote" latin:backgroundType="functional" latin:moreKeys="!text/morekeys_greater_than" /> </case> <default> - <Key + <key-style + latin:styleName="lessKeyStyle" latin:keySpec="!text/keyspec_less_than" latin:backgroundType="functional" latin:moreKeys="!text/morekeys_less_than" /> - <Key + <key-style + latin:styleName="greaterKeyStyle" latin:keySpec="!text/keyspec_greater_than" latin:backgroundType="functional" latin:moreKeys="!text/morekeys_greater_than" /> diff --git a/java/res/xml/key_styles_f1.xml b/java/res/xml/key_styles_settings.xml index 8a07827fa..956b40235 100644 --- a/java/res/xml/key_styles_f1.xml +++ b/java/res/xml/key_styles_settings.xml @@ -21,20 +21,20 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > - <!-- Base key style for the key which may have settings or tab key as popup key. --> + <!-- Base key style for the key which may have settings key as more keys. --> <!-- Kept as a separate file for cleaner overriding by an overlay. --> <switch> <case latin:clobberSettingsKey="true" > <key-style - latin:styleName="f1MoreKeysStyle" + latin:styleName="settingsMoreKeysStyle" latin:backgroundType="functional" /> </case> <!-- clobberSettingsKey="false" --> <default> <key-style - latin:styleName="f1MoreKeysStyle" + latin:styleName="settingsMoreKeysStyle" latin:keyLabelFlags="hasPopupHint" latin:moreKeys="!text/keyspec_settings" latin:backgroundType="functional" /> diff --git a/java/res/xml/keys_comma_period_symbols.xml b/java/res/xml/keys_comma_period_symbols.xml deleted file mode 100644 index 843595c27..000000000 --- a/java/res/xml/keys_comma_period_symbols.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* -** -** Copyright 2013, 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. -*/ ---> - -<merge - xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" -> - <Key - latin:keySpec="!text/keyspec_comma" /> - <!-- U+2026: "…" HORIZONTAL ELLIPSIS --> - <Key - latin:keySpec="." - latin:moreKeys="…" /> -</merge> diff --git a/java/res/xml/row_dvorak4.xml b/java/res/xml/row_dvorak4.xml index 279f64627..e7a3ee736 100644 --- a/java/res/xml/row_dvorak4.xml +++ b/java/res/xml/row_dvorak4.xml @@ -30,7 +30,7 @@ <Key latin:keySpec="q" latin:backgroundType="normal" - latin:keyStyle="f1MoreKeysStyle" /> + latin:keyStyle="settingsMoreKeysStyle" /> <include latin:keyXPos="25%p" latin:keyboardLayout="@xml/key_space_5kw" /> diff --git a/java/res/xml/row_symbols4.xml b/java/res/xml/row_symbols4.xml index 09f6b628c..2be03bd6d 100644 --- a/java/res/xml/row_symbols4.xml +++ b/java/res/xml/row_symbols4.xml @@ -20,11 +20,15 @@ <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > <Key - latin:keySpec="_" /> + latin:keySpec="!text/keyspec_comma" /> <Key - latin:keySpec="/" /> + latin:keySpec="_" /> <include latin:keyboardLayout="@xml/key_space_symbols" /> - <include - latin:keyboardLayout="@xml/keys_comma_period_symbols" /> + <Key + latin:keySpec="/" /> + <!-- U+2026: "…" HORIZONTAL ELLIPSIS --> + <Key + latin:keySpec="." + latin:moreKeys="…" /> </merge> diff --git a/java/res/xml/row_symbols_shift4.xml b/java/res/xml/row_symbols_shift4.xml index f75575bc6..4fc63c2c5 100644 --- a/java/res/xml/row_symbols_shift4.xml +++ b/java/res/xml/row_symbols_shift4.xml @@ -18,9 +18,18 @@ */ --> <merge xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > - - <include latin:keyboardLayout="@xml/keys_less_greater" /> + <include + latin:keyboardLayout="@xml/key_styles_less_greater" /> + <Key + latin:keySpec="!text/keyspec_comma" /> + <Key + latin:keyStyle="lessKeyStyle" /> <include latin:keyboardLayout="@xml/key_space_symbols" /> - <include latin:keyboardLayout="@xml/keys_comma_period_symbols" /> + <Key + latin:keyStyle="greaterKeyStyle" /> + <!-- U+2026: "…" HORIZONTAL ELLIPSIS --> + <Key + latin:keySpec="." + latin:moreKeys="…" /> </merge> diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java index 27896fd11..2762a9f25 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java @@ -67,7 +67,6 @@ public final class AccessibilityUtils { // These only need to be initialized if the kill switch is off. sInstance.initInternal(context); - KeyCodeDescriptionMapper.init(); } public static AccessibilityUtils getInstance() { diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java index 27c4732ca..3a6453128 100644 --- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java +++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java @@ -31,7 +31,7 @@ import com.android.inputmethod.latin.R; import java.util.Locale; -public final class KeyCodeDescriptionMapper { +final class KeyCodeDescriptionMapper { private static final String TAG = KeyCodeDescriptionMapper.class.getSimpleName(); private static final String SPOKEN_LETTER_RESOURCE_NAME_FORMAT = "spoken_accented_letter_%04X"; private static final String SPOKEN_SYMBOL_RESOURCE_NAME_FORMAT = "spoken_symbol_%04X"; @@ -40,24 +40,16 @@ public final class KeyCodeDescriptionMapper { // The resource ID of the string spoken for obscured keys private static final int OBSCURED_KEY_RES_ID = R.string.spoken_description_dot; - private static KeyCodeDescriptionMapper sInstance = new KeyCodeDescriptionMapper(); - - // Sparse array of spoken description resource IDs indexed by key codes - private final SparseIntArray mKeyCodeMap; - - public static void init() { - sInstance.initInternal(); - } + private static final KeyCodeDescriptionMapper sInstance = new KeyCodeDescriptionMapper(); public static KeyCodeDescriptionMapper getInstance() { return sInstance; } - private KeyCodeDescriptionMapper() { - mKeyCodeMap = new SparseIntArray(); - } + // Sparse array of spoken description resource IDs indexed by key codes + private final SparseIntArray mKeyCodeMap = new SparseIntArray(); - private void initInternal() { + private KeyCodeDescriptionMapper() { // Special non-character codes defined in Keyboard mKeyCodeMap.put(Constants.CODE_SPACE, R.string.spoken_description_space); mKeyCodeMap.put(Constants.CODE_DELETE, R.string.spoken_description_delete); diff --git a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java index 398a933df..bbc18f020 100644 --- a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java +++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java @@ -248,19 +248,15 @@ public class KeyboardAccessibilityDelegate<KV extends KeyboardView> * Synthesize a touch event from a hover event. * * @param touchAction The action of the synthesizing touch event. - * @param event The base hover event from that the touch event is synthesized. + * @param hoverEvent The base hover event from that the touch event is synthesized. * @return The synthesized touch event of <code>touchAction</code> that has pointer information * of <code>event</code>. */ protected static MotionEvent synthesizeTouchEvent(final int touchAction, - final MotionEvent event) { - final long downTime = event.getDownTime(); - final long eventTime = event.getEventTime(); - final int actionIndex = event.getActionIndex(); - final float x = event.getX(actionIndex); - final float y = event.getY(actionIndex); - final int pointerId = event.getPointerId(actionIndex); - return MotionEvent.obtain(downTime, eventTime, touchAction, x, y, pointerId); + final MotionEvent hoverEvent) { + final MotionEvent touchEvent = MotionEvent.obtain(hoverEvent); + touchEvent.setAction(touchAction); + return touchEvent; } /** diff --git a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java index a6997e2f9..18673a366 100644 --- a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java +++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java @@ -47,7 +47,7 @@ import java.util.List; * virtual views, thus conveying their logical structure. * </p> */ -public final class KeyboardAccessibilityNodeProvider extends AccessibilityNodeProviderCompat { +final class KeyboardAccessibilityNodeProvider extends AccessibilityNodeProviderCompat { private static final String TAG = KeyboardAccessibilityNodeProvider.class.getSimpleName(); private static final int UNDEFINED = Integer.MIN_VALUE; diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index cf68c565d..89a60cc1d 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -467,15 +467,24 @@ public class Key implements Comparable<Key> { @Override public String toString() { - final String label; - if (StringUtils.codePointCount(mLabel) == 1 && mLabel.codePointAt(0) == mCode) { - label = ""; - } else { - label = "/" + mLabel; + return toShortString() + " " + getX() + "," + getY() + " " + getWidth() + "x" + getHeight(); + } + + public String toShortString() { + final int code = getCode(); + if (code == Constants.CODE_OUTPUT_TEXT) { + return getOutputText(); } - return String.format(Locale.ROOT, "%s%s %d,%d %dx%d %s/%s/%s", - Constants.printableCode(mCode), label, mX, mY, mWidth, mHeight, mHintLabel, - KeyboardIconsSet.getIconName(mIconId), backgroundName(mBackgroundType)); + return Constants.printableCode(code); + } + + public String toLongString() { + final int iconId = getIconId(); + final String topVisual = (iconId == KeyboardIconsSet.ICON_UNDEFINED) + ? KeyboardIconsSet.PREFIX_ICON + KeyboardIconsSet.getIconName(iconId) : getLabel(); + final String hintLabel = getHintLabel(); + final String visual = (hintLabel == null) ? topVisual : topVisual + "^" + hintLabel; + return toString() + " " + visual + "/" + backgroundName(mBackgroundType); } private static String backgroundName(final int backgroundType) { diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 495cfa981..77877143b 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -381,14 +381,12 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap; mLanguageOnSpacebarTextSize = keyHeight * mLanguageOnSpacebarTextRatio; - final MainKeyboardAccessibilityDelegate accessibilityDelegate; if (AccessibilityUtils.getInstance().isAccessibilityEnabled()) { - accessibilityDelegate = new MainKeyboardAccessibilityDelegate(this, mKeyDetector); - accessibilityDelegate.setKeyboard(keyboard); + mAccessibilityDelegate = new MainKeyboardAccessibilityDelegate(this, mKeyDetector); + mAccessibilityDelegate.setKeyboard(keyboard); } else { - accessibilityDelegate = null; + mAccessibilityDelegate = null; } - mAccessibilityDelegate = accessibilityDelegate; } /** diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 7bf2f6c5c..ff6fd86d0 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -676,10 +676,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element, private void onDownEvent(final int x, final int y, final long eventTime, final KeyDetector keyDetector) { + setKeyDetectorInner(keyDetector); if (DEBUG_EVENT) { printTouchEvent("onDownEvent:", x, y, eventTime); } - setKeyDetectorInner(keyDetector); // Naive up-to-down noise filter. final long deltaT = eventTime - mUpTime; if (deltaT < sParams.mTouchNoiseThresholdTime) { diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index 40c915c8d..ab2555802 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -602,7 +602,7 @@ public final class KeyboardTextsTable { /* keyspec_right_double_angle_quote */ "\u00BB|\u00AB", /* keyspec_left_single_angle_quote */ "\u2039|\u203A", /* keyspec_right_single_angle_quote */ "\u203A|\u2039", - /* morekeys_tablet_comma */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,/,\",\'", + /* morekeys_tablet_comma */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,\",\'", // U+0651: "ّ" ARABIC SHADDA /* keyhintlabel_period */ "\u0651", /* morekeys_tablet_period */ "!text/morekeys_arabic_diacritics", @@ -1551,7 +1551,7 @@ public final class KeyboardTextsTable { /* keyspec_right_double_angle_quote */ "\u00BB|\u00AB", /* keyspec_left_single_angle_quote */ "\u2039|\u203A", /* keyspec_right_single_angle_quote */ "\u203A|\u2039", - /* morekeys_tablet_comma */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,/,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", + /* morekeys_tablet_comma */ "!fixedColumnOrder!4,:,!,\u061F,\u061B,-,!text/keyspec_left_double_angle_quote,!text/keyspec_right_double_angle_quote", // U+064B: "ً" ARABIC FATHATAN /* keyhintlabel_period */ "\u064B", /* morekeys_tablet_period */ "!text/morekeys_arabic_diacritics", diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java index 05d34767c..35012a452 100644 --- a/java/src/com/android/inputmethod/latin/Constants.java +++ b/java/src/com/android/inputmethod/latin/Constants.java @@ -254,14 +254,16 @@ public final class Constants { case CODE_LANGUAGE_SWITCH: return "languageSwitch"; case CODE_EMOJI: return "emoji"; case CODE_SHIFT_ENTER: return "shiftEnter"; + case CODE_ALPHA_FROM_EMOJI: return "alpha"; case CODE_UNSPECIFIED: return "unspec"; case CODE_TAB: return "tab"; case CODE_ENTER: return "enter"; - case CODE_ALPHA_FROM_EMOJI: return "alpha"; + case CODE_SPACE: return "space"; default: - if (code < CODE_SPACE) return String.format("'\\u%02x'", code); - if (code < 0x100) return String.format("'%c'", code); - return String.format("'\\u%04x'", code); + if (code < CODE_SPACE) return String.format("\\u%02x", code); + if (code < 0x100) return String.format("%c", code); + if (code < 0x10000) return String.format("\\u04x", code); + return String.format("\\U%05x", code); } } |