设置虚拟键/鼠标按钮状态而不触发事件
是否可以为计算机上的所有程序设置虚拟键状态/鼠标按钮状态,而不同时触发关联事件(例如将鼠标左键设置为当前按下而不发送鼠标按下事件)。 这是否可以通过为假键盘或鼠标设置假键盘或鼠标驱动程序来实现,当查询某个键的当前状态时,该驱动程序会回复您选择的答案或通过任何其他方式?
编辑: 这必须影响我没有在其他线程等中运行的代码的程序...
Is it possible to set the virtual key state / mouse button state for all programs on a computer without triggering the associated events at the same time (like setting the left mouse button to be currently pressed without sending a mouse down event). Could this be achieved by setting up a fake keyboard or mouse driver for a fake keyboard or mouse that when queried as to the current state of a key would reply giving an answer of your choice or by any other means?
Edit:
This has to affect programs that I do not have the code for running in other threads ect...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我没有完整的答案给你,但是...
Win32 函数 SetKeyboard State() 更改调用它的线程的键盘状态。
我知道这不会影响整个系统,但如果您只需要为正在开发的应用程序更改键盘状态,那么每个程序都可以调用它,读取从硬盘驱动器上的临时文件传递给它的数组。
不然……暂时不知道还有什么……
Well, I don't have a complete answer for you but...
The Win32 function SetKeyboard State() changes the state of the keyboard for the thread that called it.
I know this does not affect the entire system, but if you only need the keyboard state changed for applications you are developing, then this could be called by each program, reading in the array passed to it from a temporary file on the harddrive.
Otherwise... don't know of anything else offhand...