Jump to content

simple scripts - hold two buttons


Recommended Posts

@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:

 

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

  • Developers
2 hours ago, ji7saw said:

for now I have something like:

... and you are sure you are at the right forum?  Doubt it! ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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