Is typing hex codes to insert Unicode characters possible when using USB external keyboard on vanilla ICS or Jelly Bean? Any root modifications available to achieve this?

Or, if not possible system-wide, are there any text editing apps that will allow such behavior?

Inserting Unicode characters such as various bullets, subscript and superscript numbers, Greek letters and so on has been very useful while studying. I normally use gedit on a netbook running peppermint distro, because it's very simple and nondistracting while typing my summaries. I've ended up knowing by heart the most used hex codes. I'm planning to replace the netbook by a cheap vanilla ICS tablet (already factory-rooted) and a comfortable, decent USB keyboard, and the described feature would be mostly appreciated.

Thanks in advance!


There is a way, actually! By editing system files in a rooted device through ADB. These two pages have the answer:

First, http://source.android.com/devices/input/key-layout-files.html explains how to edit the files that map any key scan codes of your USB keyboard (or even joystick buttons and the device's physical and touch buttons) to standard Android key codes. That's an optional step, useful if there are keys in your keyboard that do nothing in Android, or to remap the ones you don't use (multimedia keys, etc.). There's an app, Key Test by Chris Boyle, that will assist identifying key scan codes from your keyboard.

Then, http://source.android.com/devices/input/key-character-map-files.html shows how to map those Android key codes to Unicode characters when typing, so you can assign, for a given keystroke and modifiers combination, any Unicode character by its hex code, or one of the "magic" hex codes below:

The system reserves two Unicode characters to perform special functions:

'\uef00': When this behavior is performed, the text view consumes and removes the four characters preceding the cursor, interprets them as hex digits, and inserts the corresponding Unicode code point.

'\uef01': When this behavior is performed, the text view displays a character picker dialog that contains miscellaneous symbols.

So to have the behavior I wanted, all that's needed is to assign \uef00 to a key combination. Sweet!


Try this app: https://play.google.com/store/apps/details?id=org.tiwu.unicodekeyboard&hl=en_US It does EXACTLY what you asked in your question. The app is free and does not contain any ads nor in-app purchases. You simply need to enter the Unicode character point, without the "U+", and then click on the character to enter it in the textbox. I hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.