holding key down not working in loop
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By TheDcoder
Hello everyone, long time since I made a post in the H&S sub-forum
I am working on a project where in a situation I would have to hold down an arrow key and release it in another statement/command, however when I wrote the code it isn't working exactly like I thought it would. Here is an example:
Send("{UP down}") Sleep(10000) Send("{UP up}") This should hold the up arrow key for 10 seconds before releasing it again, but when I run this code the cursor in SciTE moves up only once
If I hold the up arrow manually for 10 seconds it "repeats" and the cursor moves up several times until I release the key... Is this a known limitation of Send? Is there any other way I can accomplish this?
Thanks for all the help and feedback in advance! TD
-
By BlazerV60
Hi all,
I currently have this small script here:
$T_INIT = TimerInit() Do Send("{DEL down}") Until TimerDiff($T_INIT) >= 2000 ;2000 miliseconds = 2 seconds, exactly how long it takes to delete one entire row in Microsoft Word Send("{DEL up}") What the above code does is hold down the delete key for 2 seconds.
How would I make this script do the exact same thing if I had "DEL" as a variable? For example something like this: (Which by the way doesn't work)
$ChosenKey = "DEL" $T_INIT = TimerInit() Do Send("{$ChosenKey& down}") Until TimerDiff($T_INIT) >= 2000 Send("{$ChosenKey& up}")All the parenthesis and "&" symbols and brackets make this difficult.
-
By lee321987
Hello.
I'm trying to hold a key down, but this is only pressing the key "a" one time and then releasing:
Send("{a down}") MsgBox(0, '', '') EDIT: really sorry, I forgot to search first.
This question is answered here: '?do=embed' frameborder='0' data-embedContent>>
Please delete this thread if you want to.
-
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