Vert Posted September 25, 2007 Share Posted September 25, 2007 (edited) Hello, I have a quick question regarding the Send() function. I would like to know if it is possible to store a variable, then use it as such: $x = "A" Send("{" && $x && " down}") Of course, what I have above doesn't work, but that's basically what I need to do: my program gets the input of a single key from the user, then tries to hold it down. How do I accomplish this? Edited September 25, 2007 by Vert Link to comment Share on other sites More sharing options...
Fossil Rock Posted September 25, 2007 Share Posted September 25, 2007 (edited) Hello, I have a quick question regarding the Send() function. I would like to know if it is possible to store a variable, then use it as such: x = "A" Send("{" && x && " down}") Of course, what I have above doesn't work, but that's basically what I need to do: my program gets the input of a single key from the user, then tries to hold it down. How do I accomplish this?I haven't tested this but you might want to try .... $x = "A" Send('{ && }' & $x & '{ && }' & '{down}') Edit: typo... Edited September 26, 2007 by Fossil Rock Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
ashley Posted September 25, 2007 Share Posted September 25, 2007 a few tips when posing code use [*autoit] [*/autoit*] (remover the stars) and maybe this will work $x = "A" Send("$x" &" {down}") not sure if iishat u wanted ALso it NOT tested Free icons for your programs Link to comment Share on other sites More sharing options...
aslani Posted September 25, 2007 Share Posted September 25, 2007 Try this; $x = "A" Send('"{' & $x & ' down}"') [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
AlmarM Posted September 25, 2007 Share Posted September 25, 2007 Mayby: $x = "A" Send("{" & $x & "down" & "}") Try it ^^ Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
SadBunny Posted September 26, 2007 Share Posted September 26, 2007 Mayby: $x = "A" Send("{" & $x & "down" & "}") Try it ^^ I removed my previous post which contained useless information The example above will not work, since "{" & $x & "down" & "}" results in Adown and you need a space between A and down So change it to "{" & $x & " down" & "}". Note the space before down. More importantly, holding down a key is, as the helpfile states, generally only useful for games. I did it to delay RSI injuries while playing GTA San Andreas So whether this works or not depends on what you want to use it for... Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now