what you did is correct, but the keycodes of android are different. for A it is 29 not 97. see this,
http://developer.android.com/reference/android/view/KeyEvent.html On Sun, Mar 21, 2010 at 10:13 AM, Mauricio <raubvo...@gmail.com> wrote: > I understand onKeyDown should give me the key that was pressed, but > how to do that? I mean, if I do something like > > > public boolean onKeyDown(int keyCode, KeyEvent event) > { > switch (keyCode) > { > case 97 : // Letter A > DoSomething(); > break; > default : > // Do nothing > break; > } > // Indicate you took care of this event > return true; > > } > > Would it detect when I press the letter A on the keyboard? > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > > To unsubscribe from this group, send email to android-beginners+ > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > ME" as the subject. > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe from this group, send email to android-beginners+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.