Sign in to follow this  
Followers 0
bf2forlife

Send("{UP down}") isnt working

6 posts in this topic

here is my script:

PixelSearch(0,0,1024,768,0x725F4D)
if @error Then
Send("{UP down}")
Sleep(3000)
Send("{UP up}") 
EndIF

It presses up arrow only once, how i can keep it down for 3 secs?

Share this post


Link to post
Share on other sites



can't see the problem, the code is ok


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

From the helpfile:

Opt("SendKeyDownDelay",$milliseconds)

alters the length of time a key is held down before being released during a keystroke.

Perhaps it helps.

(this is a global setting, not just for the Up key but for ALL send commands)

Edited by okdewit

Share this post


Link to post
Share on other sites

Doesn't work, too :D Windows sends ~ every 50 ms a new KeyDown, i think:

$x = TimerInit()
Do
Send("{UP down}")
Sleep(50)
Until TimerDiff($x) > 3000
Send("{UP up}")

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

I am having this same kind of problem, however I am trying to send F5.

The timer above seemed to not change anything. I want the key to be held down as if it were being repeated. (Like what would happen if you held down 'a' in word).


Still learning...I love autoit. :)

Share this post


Link to post
Share on other sites

Does it work this way?

$ms = 3000 ; Time to press
$key = "UP" ; Key to press
$Old = Opt("SendKeyDelay",50)
Send("{"&$key&" "& Floor($ms/50) &" down}{"&$key&" up}")
Opt("SendKeyDelay",$Old)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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