How to simulate keyboard movements in Delphi? Thank you ,!~ Urgent use of Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061025132423204.html
I want to provide a helper tool for a game, as long as the corresponding keyboard and mouse actions are made according to the Event Response !~
But I don't know why ,??
The keyboard and mouse actions can be simulated, but only the simulated mouse action on the game interface can achieve the required action, but the simulated keyboard does not work. However, when the window focus is switched out, the simulated action is running properly! ~
It means simulating keyboard movements without responding in the game ,!~
Thank you very much for your help !~
PS: I started to do this. Program Use an endless loop to determine the response conditions,
While I & lt; 100 do
Begin
If <condition> then
<Simulate keyboard and mouse>
End;
At this time, the simulation of keyboard and mouse in the game is normal, that is, the response is a little slow.
Later it was changed to the timer control,
Procedure tmainform. timerngtimer (Sender: tobject );
Begin
If <condition> then
Begin
<Simulate keyboard and mouse>
End;
End;
End;
Both the response condition and the simulated action are normal,
However, in the game, only the Mouse Action works normally, and the keyboard action does not respond in the game.
WG really many
There are many plug-ins, but the plug-ins made by others are always uneasy. You can also change the functions as required by yourself. I am a relatively lazy person, so I always want to find the best way to be lazy!
What can be implemented theoretically? I don't know why it is ineffective in practice. I can't figure it out. I don't know where the problem is?
Someone knows how to talk about it. Thank you very much !~
Use thread
I have the same idea, but I don't have much time for programming.