The comment says is re-directs non-navigation keys to the content. It isn't intercepting the other keys, it is ignoring them (returning false).
On Thu, Mar 5, 2009 at 11:42 AM, ying lcs <[email protected]> wrote: > > Hi, > > I am trying to understand TabHost source code. In the setup() , it has: > > // KeyListener to attach to all tabs. Detects non-navigation keys > // and relays them to the tab content. > mTabKeyListener = new OnKeyListener() { > public boolean onKey(View v, int keyCode, KeyEvent event) { > switch (keyCode) { > case KeyEvent.KEYCODE_DPAD_CENTER: > case KeyEvent.KEYCODE_DPAD_LEFT: > case KeyEvent.KEYCODE_DPAD_RIGHT: > case KeyEvent.KEYCODE_DPAD_UP: > case KeyEvent.KEYCODE_DPAD_DOWN: > case KeyEvent.KEYCODE_ENTER: > return false; > > } > mTabContent.requestFocus(View.FOCUS_FORWARD); > return mTabContent.dispatchKeyEvent(event); > } > > }; > > My question is why it intersects all LEFT/RIGHT/UP/DOWN key event? If > that is the case, can i still use LEFT/RIGHT/UP/DOWN to navigate > within the TabContent (let say I have a row of buttons in the > TabContent. Can I use LEFT/RIGHT/UP/DOWN to move from 1 button to > another in the TabContent)? > > Thank you. > > > > -- 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. 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 -~----------~----~----~----~------~----~------~--~---

