Log in or register to post comments

Problems with text field input and ForwardNativeEventsToDalvik

August 23, 2013 - 4:42am #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 we add the vuforia package, you can’t type anything in the text fields.

On iOS touches and keyboard are working with no adjustment.

Does anybody have an idea, how to get the Manifest to forward keyboard events to the webview too?

 

Thx in advance

Maik

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 9:14am #11

Here is a link to your problem: http://prime31.com/support/1179/webview-keyboard-input-not-working

 

Is there actually a way, if the user clicks on a link in the embedded Webview, that then opens a fullscreen site?

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 9:03am #10

Hi, it sounds very likely that  this issue is somewhat related to some mis-behaviour in the plugin, rather than in Vuforia

as you said, you could see the same weird behaviour also without using Vuforia;

my suspect (but that's just an hypothesis) is that the plugin works with Unity by making certain "assumptions" on the view/rendering/events handling logic of Unity, and when you add a certain amount of extra "complexity" to the project (e.g. adding Vuforia, but probably also adding many other complex libraries),

something gets "broken" in those assumptions, and suddenly the keystrokes propagation is not working as expected;

anyway,

in order to assess if Vuforia is propagating the key events, I made this little experiment:

created a Vuforia project and exported to Eclipse according to the steps indicated in this tutorial:

https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse

Then, adding a custom view consisting of an EditText element (ie.e. a text box in Android), which is displayed on top of the Unity - Vuforia view;

the key events were working normally, and I was able to type in the text box without any issues.

 

So, at the moment I don't have more hints on this subject; have you tried contacting the authors of the Plugin, to see if they have any insight on what could go wrong with the web view?

 

 

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 8:15am #9

Yes, this just calls a webview in fullscreen.

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 7:32am #8

If I understand correctly this just calls a webview in fullscreen, right? Like I said, I actually need the functionality of an embedded webview.
But in fact I witnessed the same behaviour now in the demo of etcetera, without any vuforia libs...

Thats very strange...

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 7:10am #7

"EtceteraBinding.showWebPage" is out of the question four you?

Problems with text field input and ForwardNativeEventsToDalvik

August 28, 2013 - 12:05am #6

Yeah I do have to use a embedded Webview in my project. But I bought the Prime[31] Etcetera package too and had the same behaviour! (their webview is "on top" and adjustable in size too)

 

Problems with text field input and ForwardNativeEventsToDalvik

August 27, 2013 - 4:02am #5

Very very strange. Do you have to use an embedded Webview? Maybe you can also use the fullscreen webview of Prime31 Etcetera? I use the Gree Webview without text fields, so I had not yet the problem.

Problems with text field input and ForwardNativeEventsToDalvik

August 26, 2013 - 12:53pm #4

Hi,

Thx for the link.

After one more 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?

Thx

Maik

 

Problems with text field input and ForwardNativeEventsToDalvik

August 26, 2013 - 6:52am #3

Here you may find answers to your problem...

https://github.com/gree/unity-webview/issues/6

 

let me know, if you have solved the problem.

Problems with text field input and ForwardNativeEventsToDalvik

August 26, 2013 - 6:41am #2

Hi again,

has nobody ever used a Android Webview in Combination with Vuforia and Text-input? I´m really stuck on this and need help.
Like I said: The webview works perfectly fine -alone with unity. But it breaks when adding Vuforia.
I now bought the Prime[31] Plugin "Etcetera", since it includes a webview too, but I just get to the exact same point: Keystrokes are not transported onto the webview if Vuforia is in the same project.

It´s really a quite important project I´m working on. Would be happy for any suggestion.

Maik

Log in or register to post comments