I want to get Unicode character when I input into soft keyboard (I use key down event).
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//I tried this but not work
Log.d(TAG,event.getCharacters());
}
For example, when I input something like: ‘~’, ‘@’ , ‘a’, ‘ă’, ‘©’ How can I get these characters if I have keycode?
Thanks in advance!
Check out the KeyEvent docs and do a search for “@” on the page. They all appear to be on there. Also see the getUnicodeChar() method.