Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Tatanan on November 30, 2015, 06:51:14 AM

Title: Return on UIInput
Post by: Tatanan on November 30, 2015, 06:51:14 AM
When typing "Return" on a UIInput, the "onsubmit" event is triggered.
When typing "return" but on the numerical part on the keyboard, no onsubmit is triggered.
So, one "return" works and one "return" doesn't work.

Could can i make both one work?
Title: Re: Return on UIInput
Post by: ArenMook on December 01, 2015, 07:31:23 AM
I already addressed it in the Pro version of NGUI. Open up UIInput.cs, search for "KeyCode.Return" and add handling for Keycode.KeypadEnter like so:

Line 801:
  1. if (UICamera.GetKeyDown(mCam.submitKey0) || (mCam.submitKey0 == KeyCode.Return && UICamera.GetKeyDown(KeyCode.KeypadEnter)))

Line 816:
  1. if (UICamera.GetKeyDown(mCam.submitKey1) || (mCam.submitKey1 == KeyCode.Return && UICamera.GetKeyDown(KeyCode.KeypadEnter)))
Title: Re: Return on UIInput
Post by: tbrewerart on December 14, 2015, 05:48:35 PM
It seems that the Return key is not recognized (Submit) with NGUI input field on Mac OSX web player in 5.3.0f4.   I cannot execute multiplayer chat using submit.  If I use the OnChange field it works –– but with the expected results:  continual readout. Return Key submit works fine in the Unity editor. 

This seems to be a Unity bug, not NGUI, yes?  Is there a fix?

I am uncertain what to do here.  Is there a temporary workaround?

Thanks for your time.
Title: Re: Return on UIInput
Post by: ArenMook on December 14, 2015, 10:33:41 PM
Sounds like a Unity bug, yes. I thought web player support was discontinued though, with Chrome and others no longer support plugins? Of course WebGL export has its own host of issues...