Author Topic: Return on UIInput  (Read 1979 times)

Tatanan

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 0
  • Posts: 81
    • View Profile
    • Casual Arena
Return on UIInput
« 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?
Game developer on Casual Arena.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Return on UIInput
« Reply #1 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)))

tbrewerart

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Return on UIInput
« Reply #2 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Return on UIInput
« Reply #3 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...