Author Topic: Tab navigation works in editor but not browser.  (Read 2110 times)

schellenberghq

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
  • Game Programmer
    • View Profile
    • Blog
Tab navigation works in editor but not browser.
« on: October 22, 2014, 10:02:41 AM »
I've created my own tabIndex type navigation.

For some reason though, in the Unity editor pressing tab works just fine, even when a UIInput is the current selected object. However once I build for web and try it in the browser, suddenly my tabs stop working. However if I add a KeyNavigation script from NGUI it kind of works better.

Is NGUI doing something cancel my Tab presses because the UI element doesn't have a KeyNavigation script? It's just odd that it doesn't matter because it works in the editor, but not in the browser.

Any ideas?
---------------------------
Jacob S.
Game Programmer
---------------------------

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tab navigation works in editor but not browser.
« Reply #1 on: October 23, 2014, 03:11:32 PM »
Web plugin has different rules, as far as I know. Try stand-alone.

schellenberghq

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
  • Game Programmer
    • View Profile
    • Blog
Re: Tab navigation works in editor but not browser.
« Reply #2 on: November 03, 2014, 11:02:01 AM »
Tabbing works stand alone, and in editor.

Webplayer still doesn't work, even if I use Up/Down arrows for the events. It's like NGUI is eating the event or something. This is only the case for UIInputs.

#Edit: In fact I'm fairly certain NGUI is eating the event somehow, because when I use the up/down arrow, instead of listening to my logic, the i-beam moves to the beginning or end of the typed input. How can override this behavior, or add onto it?

Yet... why would it only seem to override in the web player? Bwah...

Although somehow you have it working, but only if I use the UIKeyControl... then somehow tab works.

#Edit2: I ended up using Left+Control as Shift+Tab, and Right+Control as Tab.
« Last Edit: November 03, 2014, 12:19:00 PM by schellenberghq »
---------------------------
Jacob S.
Game Programmer
---------------------------

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tab navigation works in editor but not browser.
« Reply #3 on: November 04, 2014, 09:39:13 AM »
NGUI listens to input events in UICamera.cs. Key navigation is around line 1600 (GetDirection calls), which in turn checks GetKeyDown/GetKeyUp which are bound to Input.GetKeyDown / Input.GetKeyUp by default.