TouchPanel.IsGestureAvailable Bug #801

Korinel opened this Issue Sep 22, 2012 · 6 comments


None yet

4 participants

Korinel commented Sep 22, 2012


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

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...

Create Gestures on screen...

Expected Result...
Breakpoint hit

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:

Kind Regards


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

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

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.

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 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 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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment