Loading core/java/android/text/method/QwertyKeyListener.java +1 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ public class QwertyKeyListener extends BaseKeyListener { if (composed != 0) { i = composed; replace = true; dead = false; } } Loading core/java/android/view/KeyCharacterMap.java +14 −2 Original line number Diff line number Diff line Loading @@ -180,6 +180,8 @@ public class KeyCharacterMap implements Parcelable { private static final int ACCENT_CIRCUMFLEX_LEGACY = '^'; private static final int ACCENT_TILDE_LEGACY = '~'; private static final int CHAR_SPACE = ' '; /** * Maps Unicode combining diacritical to display-form dead key. */ Loading Loading @@ -473,14 +475,23 @@ public class KeyCharacterMap implements Parcelable { } /** * Get the character that is produced by putting accent on the character c. * Get the character that is produced by combining the dead key producing accent * with the key producing character c. * For example, getDeadChar('`', 'e') returns è. * getDeadChar('^', ' ') returns '^' and getDeadChar('^', '^') returns '^'. * * @param accent The accent character. eg. '`' * @param c The basic character. * @return The combined character, or 0 if the characters cannot be combined. */ public static int getDeadChar(int accent, int c) { if (c == accent || CHAR_SPACE == c) { // The same dead character typed twice or a dead character followed by a // space should both produce the non-combining version of the combining char. // In this case we don't even need to compute the combining character. return accent; } int combining = sAccentToCombining.get(accent); if (combining == 0) { return 0; Loading @@ -495,7 +506,8 @@ public class KeyCharacterMap implements Parcelable { sDeadKeyBuilder.append((char)c); sDeadKeyBuilder.append((char)combining); String result = Normalizer.normalize(sDeadKeyBuilder, Normalizer.Form.NFC); combined = result.length() == 1 ? result.charAt(0) : 0; combined = result.codePointCount(0, result.length()) == 1 ? result.codePointAt(0) : 0; sDeadKeyCache.put(combination, combined); } } Loading Loading
core/java/android/text/method/QwertyKeyListener.java +1 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ public class QwertyKeyListener extends BaseKeyListener { if (composed != 0) { i = composed; replace = true; dead = false; } } Loading
core/java/android/view/KeyCharacterMap.java +14 −2 Original line number Diff line number Diff line Loading @@ -180,6 +180,8 @@ public class KeyCharacterMap implements Parcelable { private static final int ACCENT_CIRCUMFLEX_LEGACY = '^'; private static final int ACCENT_TILDE_LEGACY = '~'; private static final int CHAR_SPACE = ' '; /** * Maps Unicode combining diacritical to display-form dead key. */ Loading Loading @@ -473,14 +475,23 @@ public class KeyCharacterMap implements Parcelable { } /** * Get the character that is produced by putting accent on the character c. * Get the character that is produced by combining the dead key producing accent * with the key producing character c. * For example, getDeadChar('`', 'e') returns è. * getDeadChar('^', ' ') returns '^' and getDeadChar('^', '^') returns '^'. * * @param accent The accent character. eg. '`' * @param c The basic character. * @return The combined character, or 0 if the characters cannot be combined. */ public static int getDeadChar(int accent, int c) { if (c == accent || CHAR_SPACE == c) { // The same dead character typed twice or a dead character followed by a // space should both produce the non-combining version of the combining char. // In this case we don't even need to compute the combining character. return accent; } int combining = sAccentToCombining.get(accent); if (combining == 0) { return 0; Loading @@ -495,7 +506,8 @@ public class KeyCharacterMap implements Parcelable { sDeadKeyBuilder.append((char)c); sDeadKeyBuilder.append((char)combining); String result = Normalizer.normalize(sDeadKeyBuilder, Normalizer.Form.NFC); combined = result.length() == 1 ? result.charAt(0) : 0; combined = result.codePointCount(0, result.length()) == 1 ? result.codePointAt(0) : 0; sDeadKeyCache.put(combination, combined); } } Loading