Don't get any gesture data on Android!

Hi There,

On Monogame 3.7, I try to get the gesture working on Android and it seems I don’t get any kind of gesture data. The regular touches are working fine and I also EnabledGestures. Here’s the sample code :

        //Enable DragComplete Gesture
        TouchPanel.EnabledGestures = GestureType.DragComplete;

            while (TouchPanel.IsGestureAvailable)
            {
                GestureSample MyGesture = TouchPanel.ReadGesture();

                if (MyGesture.GestureType == GestureType.DragComplete)
                {
                    rightStickState = new Vector2(MyGesture.Position2.X - MyGesture.Position.X, MyGesture.Position.Y - MyGesture.Position2.Y);
                    rightStickState.Normalize();
                }
            }

is there anything else I need to enable or something?

Regards,

Özden

Have you enabled the gestures you want to get?

I just covered this in my InputManager Tutorial too :slight_smile:
Here is a snippet of how I am registering them
image

[Edit] Not tested this on Android yet [/Edit]

Hi Charles,

Yes, infact that’s the first line in my code above.

I can use the touchcollection to do my own implementation but it seems gesture support is already built-in so wondering why it’s not working. Even registering and checking a simple gesture like Tap is not working, very strange!

Özden

Ok, ill have ro test my touch implememtation on android, pretty sure this works on Windows with a touch screen. I’ll see if i can run it in my S10 and Kundel Fire.

Ill let you know how I get on once I get around to trying it.

OK, it works fine with my code, both with the emulator and my S10, ill try my Kindel fire now.

Need to charge it up, ill let you know if I get it working on my Fire too.

Charles,

Thank you very much for letting me know that it works for you. I now suspect the Monogame version I use might be the problem as I tried on 2 different devices as well. My Monogame dll version seems to be 3.7.0.1708, could you please let me know yours?

Regards,

Özden

I tested this with the latest 3.8

Charles,

Ah, ok, I can’t move to 3.8 at the moment but will test with 3.7.1 as well.

Thank you very much for your time and help so far, it’s much appreciated!

Regards,

Özden

No worries, hope you get to the bottom of it here is my test running on my Fire.
First pic, pre load


Draging my finger moved the small red rectangle


Doubld tap, makes the red rectangle gold,

Double tap again to make the gold rectangle red.

I set the expected gestures in the Game1 constructor when I set up my input manager

On update, I check my input manager for touch status and gestures and update varialbe acordingly.

Hope you get to the bottom of your issue :slight_smile:

Hello Charles,

Thank you very much again for the lengthy reply. In my case I ended up implementing my own gesture recognizer using the touch data and but I’m sure these information will be helpfull for others.

Regards,

Özden

1 Like