Timeline for What does WPF use to capture mouse and keyboard input?
Current License: CC BY-SA 2.5
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 3, 2011 at 13:08 | vote | accept | Paya | ||
Mar 3, 2011 at 13:03 | history | bounty ended | dSebastien | ||
Mar 3, 2011 at 11:53 | comment | added | Paya | Thanks! That's quite interesting! But hooking this kind of mechanism will probably be very tricky. | |
Mar 3, 2011 at 8:04 | comment | added | Marat Khasanov | Unfortunately, I never worked with stylus and have no touch screen to test WPF stylus behavior. But I can tell you that it is very interesting how it works! HwndStylusInputProvider handles only WM_TABLET_FLICK and WM_TABLET_QUERYSYSTEMGESTURESTATUS and raises no events. There is another class called PenThreadWorker. It launches a new thread called "Stylus Input". This thread queries input events using GetPenEvent and GetPenEventMultiple functions from native DLL called "penimc.dll". Then it fires Stylus events corresponding to interop result. | |
Mar 2, 2011 at 14:20 | comment | added | Paya | But that's probably for a different question ... unless you are aware that something like that already exists? Is it possible to achieve what I'm trying to do? Block right-click in all applications regardless if it comes from mouse or stylus? | |
Mar 2, 2011 at 14:18 | comment | added | Paya | Ah, thanks. I've quickly created that example, so in rush I've missed that (I use different class with correct WM_RBUTTONUP for development). I've done further testing and have discovered where the problem lies - I use computer with stylus for development, and I thought system just translates stylus input into mouse messages and that's it (for stylus-unaware apps). So it works correctly with standard Win32 app (stylus right click does nothing), but WPF apps are still able to detect that click, because they are stylus-aware (didn't know that). So now I need something like low level stylus hook. | |
Mar 2, 2011 at 13:48 | comment | added | Marat Khasanov | Thanks. I found that your constant value for WM_RBUTTONUP is wrong. It should be 0x205. And there will be no context menu in WPF application ;) | |
Mar 1, 2011 at 22:16 | comment | added | Paya | @Marat Khasanov: I've updated the question with example project. Could you please take a look? | |
Mar 1, 2011 at 21:23 | comment | added | Paya | Well, I have my application, and I need to manage input for every single running application on the computer, regardless if they use WPF or Win32 UI. I believe hooks are the best solution for this scenario. I will post some example to reproduce the behavior soon. | |
Mar 1, 2011 at 21:01 | comment | added | Marat Khasanov | Maybe you should post an example? By the way, if you want to manage WPF input, you should look at the InputManager class. | |
Mar 1, 2011 at 20:21 | comment | added | Paya | Thanks, great info! But how is it possible low level hooks do not work when WPF uses wrappers around standard windows messages? It works great in any non-WPF applications, but the apps using WPF do not behave as expected (I can correctly detect mouse events in a WPF application, but I can't cancel that event, even though it works in any other non-WPF application). | |
Mar 1, 2011 at 19:16 | history | answered | Marat Khasanov | CC BY-SA 2.5 |