well I finally got around to testing this, many problems this week!
anyhow, good and better news here.
with the recent update the on screen keybaord was working better, now when you touch off the keyboard it sends the finished event, score 1
the issue was then that this script would not re-open the keyboard for a second time, so after many different solutions that failed I commented out the if keyboard == null.
this then opend the keyboard up for a second time but would not send the active state or end state
so I then commented out all the private bool stuff in the script and after 2 hours of messing around got the script to work, im not entirely sure what the private bool tests where for.
at the moment I have only done a simple test with 1 input type and field etc, what does the private bool effect, will I have an issue if I open a different type of keyboard.
also when I re-open it the keybaord it has the old text, this is a minor issue but is there a way to reset the text to the place holder text with a bool option in the action.
for those with android devices and after onscreen keyboard, this is the code I used, modified from jean's code and use at your own risk (needs testing a bit more I think)
// (c) Copyright HutongGames, LLC 2010-2012. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Device)]
[Tooltip("Opens the native keyboard provided by OS on the screen")]
public class OpenDeviceKeyBoard : FsmStateAction
{
[Tooltip("The KeyBoard type")]
public TouchScreenKeyboardType keyBoardType;
[Tooltip("AutoCorrection setting")]
public FsmBool autoCorrection;
[Tooltip("single or multiline setting")]
public FsmBool multiLine;
[Tooltip("Hides inputed text")]
public FsmBool secure;
[Tooltip("Swith to Alert keyboard theme")]
public FsmBool alert;
[Tooltip("The placeholder text")]
public FsmString textPlaceHolder;
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip("The text the user is entering")]
public FsmString text;
[Tooltip("Event sent when keyboard becomes active. Comes back to the state to keep using the keyboard")]
public FsmEvent active;
[Tooltip("Event sent when the user is done")]
public FsmEvent done;
private TouchScreenKeyboard keyboard;
// private bool _active = false;
// private bool _done = false;
public override void Reset()
{
keyBoardType = TouchScreenKeyboardType.Default;
autoCorrection = true;
multiLine = false;
secure = false;
alert = false;
textPlaceHolder = "";
}
public override void OnEnter()
//{
//if (keyboard == null)
{
keyboard = TouchScreenKeyboard.Open(text.Value,keyBoardType,autoCorrection.Value,multiLine.Value,secure.Value,alert.Value,textPlaceHolder.Value);
}
//}
public override void OnUpdate()
{
if (keyboard != null)
{
text.Value = keyboard.text;
if (keyboard.active)
{
// _active = true;
Fsm.Event(active);
}
if (keyboard.done)
{
// _done = true;
Fsm.Event(done);
Finish();
}
}
}
}
}