Read Touch-Events / C# / Windows Phone


I’ve a problem read the touch input from my windows phone with monogame.

TouchCollection touches = TouchPanel.GetState();
if (touches.Count > 0)

The problem is, that i don’t get any error message weather a positionX in the debug-output. (Version 3.2)

Before with Version 3.0.1 I always got Infinity…

Is my code above the correct approach?

I’ve used this tutorial:

Noone has an answer ?

That looks correct. My guess is that the XAML controls are not setup right causing input events to not get to the Game.

Did you fix this? I am having the same problem

@daveleaver - Have you run into this issue before?

No I haven’t seen this before.
@kitnel So you just created a game using the built in templates, ran it and you don’t get touch events?

Are you doing a touch or using the mouse? In the simulator you can chose to make touches or have the mouse be a mouse. Maybe this is set wrong?

I have this same problem, ‘code’ do not recognize any mouse points on emulator screen. I created project in Visual studio 2013 and Windows 8.1. Phone emulator is WP8.1. My code:


TouchPanel.EnabledGestures = GestureType.FreeDrag | GestureType.Tap;


var touchCollection = TouchPanel.GetState();

foreach (TouchLocation tl in touchCollection)

What i miss, or what is wrong?


Ok, I know what i made wrong. When I was solving the problem ‘black screen’(3.2 on Windows Phone 8 just shows black screen) i swapped Grid xml node to DrawingSurfaceBackgroundGrid, what i thing was correct(it wasn’t). Now i was reverting this change and resolve problem correctly(commanded Grid node and uncommented DrawingSurfaceBackgroundGrid bottom node) and it works.

1 Like