Hello,
This is a repost because I don't see my original, so maybe it failed
to send...
I have an Activity with 1 single View inside it and I am writing my
own customdrawn toolkit which has its own controls, so I am not using
any Android controls except this View.
So my challenge now is to obtain unicode characters formed by the
composition of key presses. I can obtain KeyUp and KeyDown events
normally with this code:
public class LCLActivity extends Activity implements
SensorEventListener, LocationListener
{
// -------------------------------------------
// Our drawing surface
// -------------------------------------------
private class LCLSurface extends View
{
......
@Override public boolean onKeyDown (int keyCode, KeyEvent event)
{
//Log.v("lclproject", "LCLSurface.onKeyDown");
super.onKeyDown(keyCode, event);
int eventResult = LCLOnKey(KeyEvent.ACTION_DOWN, keyCode, event,
(char) 0);
if ((eventResult & 1) != 0) postInvalidate();
return true;
}
@Override public boolean onKeyUp (int keyCode, KeyEvent event)
{
// First handle the KeyUp event
int eventResult = LCLOnKey(KeyEvent.ACTION_UP, keyCode, event,
event.getDisplayLabel());
if ((eventResult & 1) != 0) postInvalidate();
// Now KeyPress
//KeyCharacterMap localMap = event.getKeyCharacterMap();
....
But now I would like to compose key presses into Unicode characters.
Any ideas how to do this?
I read somewhere that maybe I should use KeyCharacterMap, but I have
no idea how to use it and there are no examples =(
Just to reinforce I'd like to mention again that I am not using
TextView and nor do I wish to.
thanks in advance for any tips,
Felipe Monteiro de Carvalho
--
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