Jump to content

Recommended Posts

Posted

@ji7saw
Hi and welcome to the AutoIt forum :)
Since you are new, I higly reccomend to you to read Forum Rules and Forum Etiquette, in which it is clearely stated:

Quote

Usually asking for a script is not taken too well, within reason. Keep in mind that this is a support forum, so please acknowledge that. We are here to help you with your scripts, not to spoon-feed code to you.

Then, for what purpose are you sending those keys?
Thanks.


Best Regards.
 

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Posted

try this

Send("{W down}", 0)
Send("{D down}", 0)
...
do your stuff
...
Send("{W up}", 0)
Send("{D up}", 0)

with _IsPressed you can check if key is down or up

#include <Misc.au3>

$hDLL = DllOpen("user32.dll")

Send("{W down}", 0)
Sleep(1000)
ConsoleWrite("key pressed " & _IsPressed(Hex(Asc("W")), $hDLL) & @CRLF)
Sleep(1000)
Send("{W up}", 0)
Sleep(1000)
ConsoleWrite("key pressed " & _IsPressed(Hex(Asc("W")), $hDLL) & @CRLF)

DllClose($hDLL)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...