Windows 8 Touch Events Global Hook in C#, Stylus Pressure and Angle
Asked Answered
F

1

12

There are some C# libraries that allow to capture mouse and keyboard events by listening to low level Windows calls by installing global hooks, but none of them allows capturing Windows 8 Stylus pressure. I would appreciate if someone could tell me what the Touch event ID is and an application that allows to listen all low level window events by ID , for example WM_KEYUP, specially those related to Touch events.

I was able to detect the stylus coordinates by listening to mouse and button events, but unable to get information about pressure. Any ideas?

In summary: - Is there a C# library that allows the interception of Touch related events, specially the stylus, in a global way (not depending of a single application)? - If not, does someone know the Hardware ID and Event IDs of Touch related events and how to decode their data? (I am looking for the pressure) - Could someone recommend me an application to listen to and filter low level windows events by HID and Event name?

Thanks in advance.

Fibrosis answered 9/5, 2014 at 9:59 Comment(0)
M
0

I don't have any touch or stylus devices to test, but I guess you may use these win32 methods via pinvoke:

  1. Hook low level mouse event using SetWindowsHookEx and id WH_MOUSE_LL.
  2. In your LowLevelMouseProc callback, get your lParam which is a MSLLHOOKSTRUCT structure.
  3. Check the dwExtraInfo, and see if there is any relationship with system gestures.
Mien answered 27/10, 2023 at 3:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.