Author Topic: Different touchscreen keypad types  (Read 4685 times)

QuasarTD

  • Guest
Different touchscreen keypad types
« on: April 30, 2012, 03:57:42 AM »
Hi There. I love NGui. It's enabled me to make interfaces so much quicker than anything you can do with the default.
Would it be possible to have the option to choose which type of keypad appears for UIInput from the list below. That would be great thanks.

http://unity3d.com/support/documentation/ScriptReference/iPhoneKeyboardType.html



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Different touchscreen keypad types
« Reply #1 on: April 30, 2012, 06:11:01 AM »
I suggest you doing a quick edit of UIInput on your end for now. If I add the ability to specify the type of data for mobile devices, I'll need to also implement logic for this on the non-mobile side -- rejecting letters if the input is numeric, or validating numbers if it is, for example. It's a fairly extensive task. I'll do it eventually, just not in the next few weeks.

QuasarTD

  • Guest
Re: Different touchscreen keypad types
« Reply #2 on: April 30, 2012, 06:20:14 AM »
Thanks for the quick reply. I have done the edit to UIInput. For anyone else interested in this is what I have done.

  1. #if UNITY_3_4
  2.                                         mKeyboard = iPhoneKeyboard.Open(mText);
  3. #else
  4.                                         mKeyboard = TouchScreenKeyboard.Open(mText);

changed to

  1. #if UNITY_3_4
  2.                                         mKeyboard = iPhoneKeyboard.Open(mText, iPhoneKeyboardType.NumberPad);
  3. #else
  4.                                         mKeyboard = TouchScreenKeyboard.Open(mText, TouchScreenKeyboardType.NumberPad);