Home > Net >  I want to capture touch screen click events instead of the mouse to click, and how to do?
I want to capture touch screen click events instead of the mouse to click, and how to do?

Time:11-17

After installed the mouse hook, using the mouse to click events instead of touch screen click on the occasional program without response, so want to consult everybody bosses how to hook a touch screen click event (just a few points)

CodePudding user response:

If it is WPF:
The mouse trigger MouseDown,
According to the touch trigger TouchDown,

If it is Windows:
Try to [OnPreviewTouchUp] and [OnPreviewTouchMouseUp]

Protected override void OnPreviewTouchUp (TouchEventArgs e)
{
OnPreviewTouchMouseUp (e);
}

Private void OnPreviewTouchMouseUp (EventArgs e)
{

}

CodePudding user response:

If you want to do is touch the hook, you need to walk the RawInput events [WPF use the RawInput receive naked data] (https://blog.lindexi.com/post/WPF-%E4%BD%BF%E7%94%A8-RawInput-%E6%8E%A5%E6%94%B6%E8%A3%B8%E6%95%B0%E6%8D%AE.html)
  •  Tags:  
  • C#
  • Related