I would like to intercept the tab key in an EditText. I derived a new class from EditText and implemented the OnKeyListener interface. I look for event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_TAB, but here is what happens:
user presses alt -> action down / keycode alt user releasees alt -> action up / keycode alt user presses q -> action down / keycode q user releases q -> action up / keycode q So, a tab character is never intercepted by OnKeyListener...yet a tab will ultimately be deliver to the EditText, so I failed to intercept it. Next thing I did was implement my OnKeyListener differently. Instead of look for key down and keycode tab I look for key down, event alt pressed, and keycode q, as in: user pressed alt -> action down / keycode alt user presses q -> action down / event.altpressed true / keycode q user releases q user releases alt This implementation successfully intercepts an action where the user presses and holds alt while pressing q, which would ordinarily deliver a tab to the EditText, so that's great, that worked, I intercepted the tab. ...but there's two problems with relying on this approach (looking for key down, alt pressed, and keycode q). First, it still lets the other kind of tab through to the EditText and I want to intercept those tabs too. Second, I assume there is no guarantee that on other hardware besides the G1 that the tab will correspond to an alt-q in the first place, so hard-coding such a test seems inappropriate. What is the solution to this problem? Thank you. Cheers! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---