0

I need to process Gestures from a touch screen. I looked at https://msdn.microsoft.com/en-us/library/windows/desktop/dd353242(v=vs.85).aspx but the only example there was in C++, and I need it for C#. Does anyone know how to handle Gestures in C#?

I came so far as to get a private static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) function, but I'm not sure how to ID WM_GESTURE and get the GESTUREINFO in C#. Does GESTUREINFO even exist in C#?

Edit: A suggestion was made to use InkCollection - that seems mighty cool, but also seems to be a Windows Forms thing - I use WPF.

h607732
  • 3
  • 7
  • Possible duplicate of [Processing Touch and Gesture Events](https://stackoverflow.com/questions/28586942/processing-touch-and-gesture-events) – BugFinder Sep 12 '17 at 13:08
  • 1
    it doesn't, you have to bring the [DllImport] and struct declarations yourself. This has been done of course, at least visit nuget.org and search for "gestures". That *handled* argument looks suspiciously like WPF, it already supports touch. – Hans Passant Sep 12 '17 at 13:20
  • @BugFinder - Looks great...but I use WPF. Don't suppose it'll work there? – h607732 Sep 12 '17 at 13:52
  • @HansPassant - I tried to use Touch.FrameReported, but there's only actions Up, Down and Move. I'd hoped not to have to identify things like a Zoom myself. – h607732 Sep 12 '17 at 13:54
  • Well as there are books on the subject it should work - try reading Pro WPF 4.5 in C#: Windows Presentation Foundation in .NET 4.5 or Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4 .. i guess your google is broken – BugFinder Sep 12 '17 at 13:55

0 Answers0