Sign in to follow this  
Followers 0
wedding

autoit newb, trying to write a simple key press script

5 posts in this topic

greetings

i am trying to write a script so when i press the key "a" , it will press the key "b"

i dont know what to use to check if key "a" is pressed or not

while 1

if send("a") then

send("b")

endif

wend

if send("a") = true

then send("b")

endif

how do i check if key A is pressed or not? do i need to make a fucntion for this

thank you for reading

Share this post


Link to post
Share on other sites



Look in help file about _IsPressed function.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Look in help file about _IsPressed function.

thank you

#Include <Misc.au3>

If _IsPressed("a", $dll) Then

Send("b")

While _IsPressed("a", $dll)

Sleep(10)

Wend

EndIf

what is the $dll mean?

cant get it to work says varible hasnt be declared

#Include <Misc.au3>

While 1

If _IsPressed("a") Then

Send("b")

EndIf

wend

this gives me no error when i run it but its not doing what i want it to do when i press "a"

Edited by wedding

Share this post


Link to post
Share on other sites

DLL is handle to dll(default user32.dll)

You can use simple _IsPressed($sHexKey).


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Thanks for your help guys, hopefully when I get a little more time to invest I'll catch up but for now im playing the game called make it work.

Anyways thanks for the answers

Share this post


Link to post
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
Sign in to follow this  
Followers 0