From efd8b838ee9415ba4ed692ecf136a918cfa02c54 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 30 Jul 2012 15:04:27 +0900 Subject: [PATCH] Add MoreKeySpec.toString() method for debugging Change-Id: Icf9c6e15521849ffc51911c1e256c9815c1960f4 --- .../inputmethod/keyboard/internal/KeySpecParser.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index 53261205d..099e56182 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -84,6 +84,15 @@ public class KeySpecParser { } mIconId = getIconId(moreKeySpec); } + + @Override + public String toString() { + final String label = (mIconId == KeyboardIconsSet.ICON_UNDEFINED ? mLabel + : PREFIX_ICON + KeyboardIconsSet.getIconName(mIconId)); + final String output = (mCode == Keyboard.CODE_OUTPUT_TEXT ? mOutputText + : String.format("0x%04x", mCode)); + return label + "/" + output; + } } private KeySpecParser() {