如何模拟键盘输入的所有应用程序? [英] How to simulate keyboard input in ALL applications?
问题描述
我正在写一个应用程序(在C#),这是它的一部分,必须模拟并发送一些击键到另一个应用程序。我使用 http://inputsimulator.codeplex.com/ 项目模拟按键,它在许多应用中的作品,但在一些它不 - 即殊死搏斗4
I'm writing an app (in C#) which as a part of it must simulate and send some key strokes to another application. I'm using http://inputsimulator.codeplex.com/ project for simulating keys, and it works in many applications, but in some it doesn't - i.e. Mortal Combat 4.
我GOOGLE了一下,发现许多答案从这是不可能的'到'你必须使用XXX图书馆不同。等这些回答吓了我很多,甚至几乎确信我不能在那个时候这样做,但是......
I've googled about it, and found many answers varying from 'it's impossible' to 'you must use XXX library' etc. Those answered scared me a lot, and even nearly convinced I'm not able to do it at that time, BUT...
M $虚拟键盘的工作原理。它工作在所有应用程序。因此,它是可能的...难道你们任何人,聪明的人,知道我能做到这一点?
M$ Virtual Keyboard works. It works in ALL applications. So it IS possible... Does anyone of you, clever guys, know how can I achieve this?
推荐答案
好吧,我想我终于得到它的工作。我使用的尼尔P 推荐API监视器,它显示OSK电话和我之间只是细微差别。过了一会儿,我努力使自己的调用线程睡眠一段时间与记者发送消息之间并释放键,仅此而已。
Ok, I think I finally got it to work. I used API Monitor recommended by Neal P and it showed just minimal differences between OSK calls and mine. A bit later I've tried to make my calling thread sleep some time between sending messages with press and release key and that was it.
这篇关于如何模拟键盘输入的所有应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!