3

We are evaluating touchscreen keyboards and for one we need to track 10 fingers at the same time. The problem is that the touchscreen driver is very wonky (and there is no fixed version). It sends out 2500+ events for the FrameReported event each second for so many fingers. There is just no way to handle all those, even if we discard 90% at the beginning. It's simply impossible to keep up and do anything meaningful with the data.

Instead of System.Windows.Input.Touch.FrameReported, I also tried to use the (Preview) TouchMove events of the window; Same problem here.

So now I wanted, instead of using events, to poll in a separate Thread, but I cannot find information on how to get all the current touchpoints.

The only thing I found is a WinForms hack, but that isn't an option, since then I will be unable to render any WPF controls in my window.

Any solutions?

Edit 1:

This is the code, that handles all the move events:

private void UserControlTouchMove(object sender, TouchEventArgs e)
{

        //Update Position of the corresponding point
    var touch = e.GetTouchPoint(this);
    var id = touch.TouchDevice.Id;
    e.Handled = true;
    var position = touch.Position;
    //update finger on display, quick and dirty
    if (m_ShowFingers)
    {
        foreach (var finger in m_Fingers)
        {
            if (id == (int)finger.DataContext)
            {
                finger.RenderTransform = new TranslateTransform(position.X - HalfFingerSize, position.Y - HalfFingerSize);
                break;
            }
        }
    }
}
jleft
  • 3,457
  • 1
  • 23
  • 35
user1417966
  • 31
  • 1
  • 3
  • It's normal to have so many events reported. On the TouchEventArgs, you cannot just handle it and capture the touch device, this way you can capture all 10 device independently... e.Handled = true; and this.CaptureTouch(e.TouchDevice); you can check after that if the id of the event is the same as the previous... or I don't understand your question – mlemay May 25 '12 at 18:37
  • I have added the method. I don't really know why I can't keep up handling the events. I don't even do anything fancy with the data yet. It all works fine up to 5 fingers, but then the events just pile up. – user1417966 May 25 '12 at 19:17

0 Answers0