Loading core/java/android/view/KeyCharacterMap.java +11 −0 Original line number Diff line number Diff line Loading @@ -578,6 +578,17 @@ public class KeyCharacterMap implements Parcelable { return combined; } /** * Get the combining character that corresponds with the provided accent. * * @param accent The accent character. eg. '`' * @return The combining character * @hide */ public static int getCombiningChar(int accent) { return sAccentToCombining.get(accent); } /** * Describes the character mappings associated with a key. * Loading services/core/java/com/android/server/input/debug/FocusEventDebugView.java +10 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.util.Slog; import android.util.TypedValue; import android.view.Gravity; import android.view.InputDevice; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.RoundedCorner; Loading Loading @@ -335,7 +336,15 @@ public class FocusEventDebugView extends RelativeLayout { final int unicodeChar = event.getUnicodeChar(); if (unicodeChar != 0) { return new String(Character.toChars(unicodeChar)); if ((unicodeChar & KeyCharacterMap.COMBINING_ACCENT) != 0) { // Show combining character final int combiningChar = KeyCharacterMap.getCombiningChar( unicodeChar & KeyCharacterMap.COMBINING_ACCENT_MASK); // Return the Unicode dotted circle as part of the label as it is used is used to // illustrate the effect of a combining marks return "\u25cc" + String.valueOf((char) combiningChar); } return String.valueOf((char) unicodeChar); } final var label = KeyEvent.keyCodeToString(event.getKeyCode()); Loading Loading
core/java/android/view/KeyCharacterMap.java +11 −0 Original line number Diff line number Diff line Loading @@ -578,6 +578,17 @@ public class KeyCharacterMap implements Parcelable { return combined; } /** * Get the combining character that corresponds with the provided accent. * * @param accent The accent character. eg. '`' * @return The combining character * @hide */ public static int getCombiningChar(int accent) { return sAccentToCombining.get(accent); } /** * Describes the character mappings associated with a key. * Loading
services/core/java/com/android/server/input/debug/FocusEventDebugView.java +10 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.util.Slog; import android.util.TypedValue; import android.view.Gravity; import android.view.InputDevice; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.RoundedCorner; Loading Loading @@ -335,7 +336,15 @@ public class FocusEventDebugView extends RelativeLayout { final int unicodeChar = event.getUnicodeChar(); if (unicodeChar != 0) { return new String(Character.toChars(unicodeChar)); if ((unicodeChar & KeyCharacterMap.COMBINING_ACCENT) != 0) { // Show combining character final int combiningChar = KeyCharacterMap.getCombiningChar( unicodeChar & KeyCharacterMap.COMBINING_ACCENT_MASK); // Return the Unicode dotted circle as part of the label as it is used is used to // illustrate the effect of a combining marks return "\u25cc" + String.valueOf((char) combiningChar); } return String.valueOf((char) unicodeChar); } final var label = KeyEvent.keyCodeToString(event.getKeyCode()); Loading