Author Topic: UIInput and Controller Joystick going berserk  (Read 3469 times)

maaya

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 22
    • View Profile
UIInput and Controller Joystick going berserk
« on: October 13, 2014, 05:56:37 PM »
Hi,

I am porting a perfectly working Unity-NGUI game to Ouya and am running into issues with UIInput using a controller.

The joystick navigation works fine on the main menu with half a dozen buttons. (using UIKeyNavigation on each button)

But it breaks on the signup and login forms.
The Login form is very simple with 4 widgets, each with UIKeyNavigation: email (Starts Selected), password, cancel and submit buttons.

1. Once the keyboard is closed, the UIInput was setting isSelected=false which sets the UICamera.selectedObject to null and UIKeyNavigation was no longer working. I uncommented that line so that when the keyboard is closed, the input is still selected and I can use the joystick to move to the next element.

2. But with the change in #1, after entering data in any input field using the on-screen Ouya keyboard, moving the (left) joystick up or down freezes the axis value without returning it to zero (accounting for the dead zone). This is then interpreted as move-up or move-down by UICamera and it cycles through each form field - bringing up the keyboard, closing it, moving to the next field, bringing up the keyboard (if its an input field) etc.. until move the joystick in several ways to stop the cycle.

I noticed a comment in UIInput.cs that says:
// Unity has issues bringing up the keyboard properly if it's in "hideInput" mode and you happen
// to select one input in the same Update as de-selecting another.

And I checked my 2 inputs that they are not set to "Hide Input".

I am so close to wrapping this game and am stuck with this form issue.
I'd really appreciate any help/guidance.

Thanks
Usha
« Last Edit: October 13, 2014, 06:11:29 PM by maaya »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput and Controller Joystick going berserk
« Reply #1 on: October 14, 2014, 01:52:19 PM »
Turn off mouse and touch events on the UICamera.