1
votes

I'm writing a C++ Win32 application that supports both mouse and touch input. However when I put my finger on the touchscreen, then the OS moves the mouse cursor into that position.

If I move the finger across the screen, and move the mouse at the same time, then OS will cause mouse cursor flickering, one frame it's under finger, 2nd frame under old mouse position.

I want the touch input to stop changing mouse cursor position. I want to keep the 2 inputs separate - touch not affecting the mouse. I want to keep reading 2 inputs at the same time - touch not affecting the mouse.

1
Touch input has changed a lot across versions of Windows. What version(s) of Windows are you targeting? I'm not sure this is even possible, but I'd look into Raw Input to see, if you can intercept touch input and prevent from being passed on to the system. - IInspectable
I'm targeting the latest version. Windows 10. - Esenthel

1 Answers

1
votes

Here's a solution. Use WH_MOUSE_LL hook, and block mouse event cause by touching. Then compare MSLLHOOKSTRUCT->dwExtraInfo and 0xFF515700 to determine if it's a touch-caused mouse event.