在C#中捕获并发送键盘/鼠标输入 [英] Capture and send keyboard / mouse input in C#
问题描述
我正在寻找发送和接收键盘信息的方式,无论什么应用程序都有焦点。我记得在大学看到关于一个旧的Windows API的演示文稿,可以让你更改光标位置并发送正确的点击等。
I am looking for a way to send and receive keyboard information regardless of what app has focus. I remember back in College seeing a presentation about an old Windows API that let you change the cursor position and send right clicks and such.
除了User32.dll有一种方式使用.net框架来执行此操作?
Besides User32.dll is there a way to do this with the .net framework?
推荐答案
AFAIK,没有办法捕获GLOBAL键盘和鼠标事件。但是有几篇关于CodeProject的文章展示了.NET类包装器的创建。
AFAIK, there's no way to capture the GLOBAL keyboard & mouse events. But there are a few articles on CodeProject which demonstrate the creation of .NET class wrappers for the same.
您可以在这里查看:
2)全球鼠标和键盘库
编辑:BTW,我在C#中使用第一个库创建了一个SMALL键盘记录器:)
BTW, I had created a SMALL keylogger in C# using the 1st library :)
这篇关于在C#中捕获并发送键盘/鼠标输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!