I have a problem with the softkeyboard and the surfaceview. I want to
write text on the surfaceview throught the onDraw method when I type
in the soft keyboard. I get the event but I couldn't get the
corresponding character to draw. I see a lot of post, and in someone
it say that the getNumber() should respond with the corresponding
character but it fail with badcodes. Here is may onKey method:
public boolean onKey(View v, int keyCode, KeyEvent event) {
Log.d(LOGTAG, "keyCode: "+keyCode+" - " + event.getNumber()+"
Un: "+event.getUnicodeChar());
this.charToDraw = ""+event.getNumber();
this.forceOnDraw();
return false;
}
The DDMS show this:
01-18 16:35:27.440: DEBUG/xxxxxxx(6227): keyCode: 47 - �� Un: 115
01-18 16:35:27.440: DEBUG/xxxxxxx(6227): onDraw: WRITING:��
I also try to use:
char keyCode = (char)keyCode;
String keyCode = "" + keyCode;
but get the same result.
I need to transform the keyCode to a string to display with the
drawString of the surfaceview canvas.
I trying all of this on a Motorola Xoom.
Thanks
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en