Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Problems with text field input and ForwardNativeEventsToDalvik

Discussion in 'Editor & General Support' started by jvn, Aug 23, 2013.

  1. jvn

    jvn

    Joined:
    Aug 4, 2013
    Posts:
    1
    Hi there,
    we have problems with text field input in a scrollable webview (from Gree) (based kogarasi).
    In order to make the webview scrollable we set "unityplayer.ForwardNativeEventsToDalvik" true. But then we get problems with text field input. If you tab into a text field in the webview, the android keyboard comes up, but the keystrokes are not transported to the webview.
    The webview itself works with unity, but as soon, as I add the vuforia package, I can’t type anything in the text fields.
    On iOS touches and keyboard are working with no adjustment.
    Does anybody have an idea, how I get the Manifest to forward keyboard events to the webview too?

    Thx in advance,
    Jenny
     
  2. VarietyARLabs

    VarietyARLabs

    Joined:
    Aug 26, 2013
    Posts:
    4
    Hi,

    after one day of trial and huge error, I just might have found a lead!
    After some more research: I thought it might be an issue about, which window had "focus", which is why I tried to change the webview sources in something like:

    mWebView.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
    // TODO Auto-generated method stub
    switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN:
    case MotionEvent.ACTION_UP:
    if (!v.hasFocus()) {
    v.requestFocus();
    }
    break;
    }
    return false;
    }
    });

    But, it didn´t change anything!

    But now I tried some more and I found something:
    There are some keys that actually do work!
    Unforturnately I don´t know the mac keystrokes for most of them T.T
    But among them is the "€" as well as "pi" the "root" sign, the multiplier sign and the "divide-sign".
    That´s why I´m thinking among the lines of: maybe the keyboard layout is screwed up!? - maybe it is on some math-layout.
    That is the good news: the bad news is: I have no idea how to proceed from here.
    Do you have any ideas about what I should try?

    The same topic is discussed in the Vuforia forum, because like mentioned above: the webview works fine in a all-unity project, but gets no interaction after implementing Vuforia and while I´m able to help with normal touch by using "forwartNativeEventsToDalvik", it doesn´t work for keyboard input.

    Thx

    Maik
     
  3. alex_galkin

    alex_galkin

    Joined:
    Oct 28, 2013
    Posts:
    4
    Had anyone any luck with that? I have the same issue right now and cannot figure out the way to solve it (tried dozens of guesses and proposals from forums).
     
  4. Wells.W

    Wells.W

    Joined:
    Nov 19, 2013
    Posts:
    3
    Hi, I get it worked by using a plugin called UniWebView from the Asset Store here ( https://www.assetstore.unity3d.com/#/content/12476 ) It seems there is an activity issue which causes the Android can not receive the button tap. For those who later found this post, I suggest you try that plugin to avoid the countless bugs in Gree web view.