Touch Input for Windows Phone

Having problems with Windows Phone touch input. Basically my touch input is not getting detected. Been trying to fix for about 2 hours and have tried different methods but to no success. This code works fine in XNA but in Monogame it just doesnt detect that im touching the screen. Im using a device too.
This is in my Update method:

TouchCollection touchCollection = TouchPanel.GetState();

foreach (TouchLocation tl in touchCollection) 
{
     if ((tl.State == TouchLocationState.Pressed)
            || (tl.State == TouchLocationState.Moved)) 
            {
                this.Exit();
            }
 }

EDIT: Apparently its something to do with DrawingSurfaceBackgroundGrid in GamePage.xaml. If I use the default DrawingSurface instead of DrawingSurfaceBackgroundGrid I just get a black screen when I run the code. I love using Monogame for Desktop, but using it for Windows Phone is ridiculous. All these problems. I wanted to use it because it supports InAppPurchases unlike XNA. But it looks like I will have to do without them. Im switching back to XNA.

I also tried the input in other Monogame projects and it didnt work then either.

Just tried reinstalling monogame. Still nothing works.

Ok… good luck with your game.

I don’t mean to make you mad and I know I sound like an asshole, I mean I love Monogame. The work you guys are doing is great and I use it for desktop all the time and will continue to use it for desktop development, but I just cant seem to get my head around all the windows phone complication stuff. It seems much easier to develop for Windows Phone with XNA due to all these strange bugs that MG gives me. Keep up the awesome work anyway, I like it.

Not mad at all… just didn’t want you to think we were ignoring your posts. :wink:

Ok cool, keep up all the great work you guys are doing! :smile:

Hi Aido97,

it’s working inserted in one of my games for me, could you post the project to compile it?

p.s. you can use in-app purchases in XNA through reflection (will only work in WP8 , of course).

p.s.2 You can also use Fortumo instead of microsoft billing to implement in apps. In fact I think you can even add in-apps to WP7 with Fortumo.

Give this a try:

Ctrl-F and find this section “MonoGame’s Gesture Processing Patches”

The author provided 3 ways to deal with the touch detection bug. I haven’t tested them myself yet, but you might want to check them out.

1 Like

Oh man thank you so much for that, the touch input works. Now I can continue in Monogame! :smiley:

Actually I played a bit with the 1st and 2nd solutions tonight and realized that they are not for me because I’m using MonoGame 3.2.2 binary downloaded via nuget. I don’t want to go through all the troubles to get the source code and mess up my project’s structure, and I also don’t want to choose the original XNA touch API because it is not cross-platform. What should I do? =(