Through testing, I found the answer. Most unicode characters are
handled by onKeyMultiple event handler. If you get keyCode ==
KeyEvent.KEYCODE_UNKNOWN and event.getAction ==
KeyEvent.ACTION_MULTIPLE, then you can obtain the unicode character by
calling event.getCharacters(). It is actually all documented, though a
bit hard to find.

On Aug 25, 9:41 pm, Miha <[email protected]> wrote:
> In my activity, I have an onKeyUp and onKeyDown event handlers, which
> are called for normal characters and even for some unicode characters
> like cedilla (ç). But not for others like á, à, ü, é, č, š, ž, è, ...
>
> Why is that? And how can I register those key presses (or better yet,
> characters)?
>
> I am testing this on a Samsung Galaxy S2 with soft keyboard (samsung
> and swype keyboards), where accented characters are available with a
> long key press. It is interesting to note that even cedilla (ç), which
> is available with the same long press, does get registered with
> onKeyUp/Down event handler.
>
> I am using onKeyUp/Down on the activity. There is no text box or
> anything text related on the main view. Just a modified ImageView.
>
> I tested this in an emulator as well (default android image 2.3.3) and
> behaviour is similar to real device.
>
> Thanks,
>  Miha.

-- 
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

Reply via email to