Jump to content

Holding Delete Key Down

Recommended Posts

Hi all,

I currently have this small script here:

$T_INIT = TimerInit()
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()
Send("{$ChosenKey& down}")
Until TimerDiff($T_INIT) >= 2000 
Send("{$ChosenKey& up}")

All the parenthesis and "&" symbols and brackets make this difficult.

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

  • Create New...