How to simulate keyboard movements in Delphi? Thank you ,!~ A little urgent

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.