TouchPanel.IsGestureAvailable Bug #801

Closed
Korinel opened this Issue Sep 22, 2012 · 6 comments

Projects

None yet

4 participants

@Korinel
Korinel commented Sep 22, 2012

Description:

TouchPanel.IsGestureAvailable appears not to be getting updated when new events occur.

Repro:
Create new MonoGame Win8 RT project
Create new XNA 4.0 WP7 game

Add a using:
using Microsoft.Xna.Framework.Input.Touch;

Add to the Initialize before the base call:
TouchPanel.EnabledGestures = GestureType.Hold | GestureType.Tap | GestureType.DoubleTap | GestureType.Flick | GestureType.VerticalDrag | GestureType.HorizontalDrag;

Add to the update method before the base call:
while (TouchPanel.IsGestureAvailable)
{
GestureSample gesture = TouchPanel.ReadGesture();
}

Put breakpoint on the GestureSample line...

Run...
Create Gestures on screen...

Expected Result...
Breakpoint hit

Result
Breakpoint not hit.

WP7 breaks as expected.

Root casue?
Seems TouchPanel.IsGestureAvailable is not updated

Work Around:

TouchCollection touches = TouchPanel.GetState();

The above appears to force an update of TouchPanel.

MSDN doc:
http://msdn.microsoft.com/en-us/library/ff827740.aspx

Kind Regards

@tomspilman
Member

Thanks for the clear test case. We're aware of it and will have a bug fix soon.

@tomspilman tomspilman was assigned Oct 9, 2012
@tomspilman
Member

The fix for this is posted... please test it.

@davefer
davefer commented Oct 16, 2012

Hi all -

I'm very much a newby to GitHub and MonoGame, but I have run into your issue 801 and have a pressing, professional need for a fix, if it exists.

It sounds like you've checked in a fix to this, but when I pulled the latest MonoGame.git, the behavior I get is sort of a 1% fix. That is to say that after I tap my screen, about 1% of the time, I get a corresponding "true" from TouchPanel.IsGestureAvailable.

I wonder if I got your fix for Issue 801 when I pulled down the latest MonoGame.git.

Could someone clarify / confirm that this issue has been fixed and that the fix is in the main MonoGame project? (And if someone is feeling especially charitable, perhaps could help me ensure I'm using GIT Bash properly to get that fix.)

Thanks all.

 - Dave F.
@tomspilman
Member

The latest code in the MonoGame develop3d branch should work for you.

If it does not please submit a new bug report with details on how to reproduce your issue.

@Nezz
Member
Nezz commented Nov 3, 2012

I believe this was sorted out with tom's touchpanel fixes so can be closed.

@tomspilman tomspilman closed this Nov 3, 2012
@Korinel
Korinel commented Nov 4, 2012

Sorry, was a bit side tracked.... v3.0 beta does indeed fix the issue I reported.

@RandomCache RandomCache pushed a commit to RandomCache/MonoFramework that referenced this issue Nov 12, 2013
@tomspilman tomspilman Refactored TouchPanel to maintain seperate event list and state for t…
…ouch and gestures.

Fixes the following issues:

MonoGame/MonoGame#770
MonoGame/MonoGame#801
72dddbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment