Most text isn't delivered through key events, since key events represent physical keys and not Unicode characters. The IME sends most of its text through the editing with the InputConnection interface.
On Wed, May 20, 2009 at 11:34 AM, blindfold <[email protected]>wrote: > > Hi, > > I have a regular EditText that nicely pops up the soft keyboard when > the hardware keyboard is closed. Entering data also works fine and > gets preserved by my app. However, when I try to track individual key > presses using the following code, > > EditText myedit; > > // Only gets number keys?? > myedit.setOnKeyListener(new EditText.OnKeyListener() { > @Override > public boolean onKey(View v, int keyCode, KeyEvent event) { > Log.i("OIC","keycode "+keyCode); > KeyCharacterMap kmap = KeyCharacterMap.load(event.getDeviceId > ()); > if (kmap.isPrintingKey(keyCode) && event.getAction() == > KeyEvent.ACTION_DOWN) { > // Blah, blah > } > return false; > } > }); > > no key presses show up in LogCat *except* for number key presses > (0-9). No letters, punctuation, or anything other than numeric digits > and a few special keys such as Del and Return. Is this a bug or a > feature? In this particular case I am only interested in individual > alphabetic key presses, but the listener fails to report them. What's > wrong? > > I'm using the official Android 1.5 on my ADP. > > Thanks > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

