uscript and ios keyboard

Post here if you have questions about using uScript.
Post Reply
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

uscript and ios keyboard

Post by litow »

Hi.
Getting back into uscript after finishing a few other projects.
You probably get this a lot. But. I still cannot thank you guys enough for offering such a tool! This is really such a great plugin. You deserve all the accolades.

Im pushing my knowledge a lot in the few days I have available.
Ive been browsing the forums and online for a day or so now. And I cant seem to wrap my head around this question yet.
Sorry if I missed a related post or if the question is too basic or not directly related to uscript.

How does one trigger and use an ios keyboard through uscript?
So to enter data into a menu/game/...

I got the feeling I need to build my own.
Which Id like to avoid.
Id really like to make an effort to learn how to trigger and use the native one. If at all.

I see there is some sort of support from some plugins for Playmaker.
Which makes me think there should be a basic way to interface an ios native keyboard directly with uscript?

Do I need to get playmaker and mix it in with uscript?
But Id like to avoid having to learn yet another tool with the short time I have available.

thanks in advance!
litow
User avatar
TrapZZ
Power User
Posts: 4087
Joined: Sun Jun 26, 2011 12:49 pm

Re: uscript and ios keyboard

Post by TrapZZ »

Thanks for the kind words!

As far as I've known no one has written a custom node to leverage this. It should be fairly easy to accomplish, if you'd like to attempt it we can help talk you through it. Otherwise one of our other power users might get to it before we do.

I believe it would just be a matter of wrapping this functionality:
http://docs.unity3d.com/ScriptReference ... .Open.html
Need a break from uScripting? Join my brother and I every Thursday as we drink beer and continue our quest to review every US NES game ever made (the actual games on the actual hardware, not emulated).
http://www.brothernights.com
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

Ah! I see.
Thank you for the lead!!!!

That's what I was hoping for to be honest.
I know python back and forth. But Im still useless on c#/boo/java scripting.
Not for lack of will to learn it. My day job takes me into the 70-80+ hour weeks.
So can only poke at this in my freetime.

I can now see unity offers them through the api, and i can understand it would be probably easy for a pro user to implement them. On the long run. It would be cool if we had some native access to these options in uscript.
I assume they are not maybe because it's easy to implement them...

So... Until I have the time to learn c# I may have to plea for some help.

Having said that.
Yes. Ill def take this as a learning experience.
If some kind spirit can show me how to translate such an api call into a uscript node. Im sure I (and maybe other basic users) could expand with other calls as well.

Until then, Ill start poking the web for more leads...

Thank you so much for the help.
User avatar
TrapZZ
Power User
Posts: 4087
Joined: Sun Jun 26, 2011 12:49 pm

Re: uscript and ios keyboard

Post by TrapZZ »

Here's a quick tutorial which will probably get you most of the way:
http://uscript.net/docs/index.php?title ... Tutorial_1

Let me know where/when you get stuck and we'll push through together.
Need a break from uScripting? Join my brother and I every Thursday as we drink beer and continue our quest to review every US NES game ever made (the actual games on the actual hardware, not emulated).
http://www.brothernights.com
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

You are a star.
Im on it...

And Happy holidays to you and the team!
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

Nope. Way more to learn than I can take advantage of at the moment.
That example is great. But it does imply I should know unity3d api calls Im not familiar with (delegation, handlers, unityEngine.Time, ...). The example does expect that knowledge, which may be fair, but does not really expand on any of the steps. Which is also fair.

Even if I invested into getting that knowledge right now (which I tried), that example it's still a long way for my level of c#/uscript coding to be able to implement the TouchScreenKeyboard into uscript.
Spent a few hours on it. Searched and stole bits from other nodes. And still got no where.

Again. Im not against learning it. Nor Im against coding it. Just cant afford the time investment.
One of the reasons why I wanted to try uscript.

Ill keep digging (I know, not a great way to spend Xmas days.. ehehehe) but I may have to wait for a good soul to share.

In any case. This is what I got.
It just prints the google address on my ipad. But no keyboard after pressing on the button.

Code: Select all

using UnityEngine;
public class uScriptAct_iOsKeyboard : uScriptLogic
{

private string inputURL = "http://google.com" ;
private string m_Text = "input text";
private TouchScreenKeyboard keyboard;
public enum KBType { Default, ASCIICapable, NumbersAndPunctuation, URL, NumberPad, PhonePad, NamePhonePad, EmailAddress };


public bool Out { get { return true; } }

public void In(
string Text,
KBType KeyboardType,
bool autocorrection,
bool multiline,
bool secure,
bool alert,
string textPlaceholder,
out string TextOutput
)
{
textPlaceholder = m_Text;
TextOutput = Text;
}


public void OnGUI() {
if (GUI.Button(new Rect(0, 10, 200, 32), inputURL))
keyboard = TouchScreenKeyboard.Open(inputURL, TouchScreenKeyboardType.URL);

if (keyboard != null)
inputURL = keyboard.text;
}
}
Last edited by litow on Sat Dec 27, 2014 3:53 am, edited 1 time in total.
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

This posts seems to hint that Im on the right path.
But. Still not sure why i get no keyboard...

http://forum.unity3d.com/threads/unity- ... ng.248523/

Im starting to think something else is at play. Docs say even just the gui text field should pop up a keyboard.

http://docs.unity3d.com/Manual/MobileKeyboard.html
User avatar
TrapZZ
Power User
Posts: 4087
Joined: Sun Jun 26, 2011 12:49 pm

Re: uscript and ios keyboard

Post by TrapZZ »

I'm sorry for the late reply, I've been out with the flu.

I haven't used this functionality myself so I can't be much assistance yet. However, we can add this to our list of requests.
Need a break from uScripting? Join my brother and I every Thursday as we drink beer and continue our quest to review every US NES game ever made (the actual games on the actual hardware, not emulated).
http://www.brothernights.com
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

Sorry to hear!!!
Bad timing of the year as well. Very sorry...

Please. Any help would be appreciated. Im back to work in a few days myself, so Im slowly throwing the towel.

I tested a few options, from GUI text fields, to the touchkeyboard, to the new UI in 4.6.
Read a load of related topics on the unity3d and similar forums.
Coded a few variations.
Installed two version of xcode to check the keyboard settings.
Still got no where.

Im starting to think it may be related to other configurations. But dead in the water at the moment.

Im running the latest uscript update with the latest unity3d release on a macbook pro running osx 10.6.8. (wanted to install and try Yosemite but hearing too much other trouble with that). In case anyone else has suggestions on the matter.
Thank you in advance.
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

Also. Testing this with Unity Remote 4.
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

Related thread on the unity3d forum
http://forum.unity3d.com/threads/ios-ke ... up.289726/
litow
Contributor
Posts: 76
Joined: Wed Apr 10, 2013 3:11 am

Re: uscript and ios keyboard

Post by litow »

It appears to be a bug in the latest 3 unity3d 4.6.1 patches
http://forum.unity3d.com/threads/4-6-1- ... ng.289034/
User avatar
Scott
Power User
Posts: 2607
Joined: Sat Jun 25, 2011 2:59 pm
Location: Boston, MA
Contact:

Re: uscript and ios keyboard

Post by Scott »

DOH! Glad you tracked down some information on the issue!
Scott Blinn
CEO & Creative Director
Greyborn Studios
Post Reply