I am facing a problem while trying to read non english characters in android app with something similar to onKeyDown() method. I need to read the letters one by one because i am implementing hangman game for many languages and i have to trigger an action after each entered game.
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.v("Hangman", "KEY : " + keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_A:
validateGuess('A');
break;
for english alphabet is ok but only KeyEvent.KEYCODE_W is not working, I have no idea why
Any suggestions about how to read german or other nonstandard letters?
Don’t look at the keyCode, look at the
event.getUnicodeChar()instead, but have a look at the details:http://developer.android.com/reference/android/view/KeyEvent.html#getUnicodeChar()
For example remember that some characters are enteredby first pressing one or more buttons and then another (not talking about shift etc).