Search code examples
c#wpftouchmulti-touch

Touch events not firing C# WPF


I have created a program that subscribes to WPF's touch events. Everything has been working as expected over the last few months, but yesterday none of the touch events would fire. I tried creating a new, simple program to test touch events, but it works the same, all of the touch input gets sent as mouse events, even though the cursor changes from the mouse arrow to the touch crosshairs.

I restarted the computer several times and reinstalled the drivers but it did not seem to change anything. I have tried using a different brand of touch screen with different drives which also used to work and am seeing the exact same issue. Using the touch screen's built in test tool, I can see that touch and multitouch are working as I expect and viewing the Pen and Touch section of the System Properties confirms that the computer is recognizing the touch screen.

EDIT: I continued to test the monitor and it appears that multitouch is working in other windows programs like paint. The touch appears to not work only in my applications.

Has anyone else experienced this or have any idea how to re-enable the touch events?


Solution

  • Somehow, converting the Window to a UserControl and hosting inside a WinForms Window fixed the problem and touch events fire as they did before.