拦截鼠标输入 [英] Intercept mouse input
问题描述
我想知道是否有一种方法来拦截和修改鼠标输入之前到达窗口?
I was wondering if there is a way to intercept and modify mouse input before it gets to windows?
我想要做的是拦截鼠标运动事件,对值应用一些自定义缩放和加速度,然后继续传递它们。我需要一些可以在输入到原始输入API或DirectInput之前做的事情。
What I'm wanting to do is intercept mouse motion events, apply some custom scaling and acceleration to the values, and then continue passing them along. I'd need something that can do this before the inputs get to the raw input API or DirectInput.
推荐答案
所有鼠标输入,包括DirectInput,在登录期间和SAS屏幕等,您将需要加载过滤器驱动程序到鼠标驱动程序堆栈。
In order to affect all mouse input, including DirectInput, during logon and the SAS screen, etc., you'll need to load a filter driver into the mouse driver stack.
其他人完成它,例如 http://www.maf-soft.de/mafmouse/
在Windows DDK中应该有一个 moufiltr
示例,您可以将其作为起点。您很可能想要使用虚拟机进行开发,因为开发机器上的驱动程序中的错误很难从中恢复。
There should be a moufiltr
sample in the Windows DDK which you can use as a starting point. You will most likely want to use a virtual machine for development since errors in a driver on your development machine could be difficult to recover from.
这篇关于拦截鼠标输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!