Author Topic: choose between regular mobile keyboard and numeric pad?  (Read 2246 times)

harrisonpink

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
choose between regular mobile keyboard and numeric pad?
« on: April 03, 2015, 12:27:04 AM »
Hi all,

I would love to be able to choose when the user clicks a text field between having the normal mobile keyboard pop up and the numeric keyboard. I know Unity has TouchScreenKeyboardType.NumberPad, but I know NGUI is using its own UIInput script.

Any help to get this working would be very appreciated!

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: choose between regular mobile keyboard and numeric pad?
« Reply #1 on: April 04, 2015, 04:08:23 AM »
UIInput.keyboardType lets you specify what kind of keyboard it will be.

harrisonpink

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: choose between regular mobile keyboard and numeric pad?
« Reply #2 on: April 05, 2015, 02:31:42 AM »
Thank you for the info! I'm not sure where to actually execute this code though. Right now, when you tap a text box that accepts input, it automatically pops open the keyboard. Where should I add the code that specifies what type of keyboard it should be?

(Teaching myself programming is hard! Thank you for your assistance!)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: choose between regular mobile keyboard and numeric pad?
« Reply #3 on: April 06, 2015, 07:42:59 AM »
It's set in inspector on the UIInput when you are targeting a mobile platform.

harrisonpink

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: choose between regular mobile keyboard and numeric pad?
« Reply #4 on: April 09, 2015, 12:24:15 PM »
Is this something I can change on the fly? I'm making a quiz app and some questions are words and some are numbers.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: choose between regular mobile keyboard and numeric pad?
« Reply #5 on: April 09, 2015, 04:01:05 PM »
Yes. GetComponent<UIInput>().keyboardType = ...