Sign in to follow this  
Followers 0
Orange9

Holding down a key on the keyboard

24 posts in this topic

Yeah, i've read the help function and and it tells me how to hold a key on the keyboard. Something like this: Opt("SendKeyDownDelay", x) where x is the number of milliseconds to hold the button for. Sure, thats great, but there is no parameter for me to input the key i want to press.

The other method, where it says something like this:

Send("{a down}") ;Holds the A key down

Send("{a up}") ;Releases the A key

Yeah, i can input the key i want, but theres no parameter for me to input the time i want it to hold the button. So...im kinda lost lol. It'd be great if someone can help me on this ^^

Share this post


Link to post
Share on other sites



Yeah, i've read the help function and and it tells me how to hold a key on the keyboard. Something like this: Opt("SendKeyDownDelay", x) where x is the number of milliseconds to hold the button for. Sure, thats great, but there is no parameter for me to input the key i want to press.

The other method, where it says something like this:

Send("{a down}") ;Holds the A key down

Send("{a up}") ;Releases the A key

Yeah, i can input the key i want, but theres no parameter for me to input the time i want it to hold the button. So...im kinda lost lol. It'd be great if someone can help me on this ^^

Hi,

First this Opt("SendKeyDownDelay", x)

Second this Send("your key")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

What about

Send ( "{a down}" )

Sleep ( 1000 )

Send ( "{a up}" )

to hold it for 1 second ?


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites

Now this wont be confusing for people who would like to help you when you have

two similar topics... You probably noticed you posted the first one in the GUI-forum,

but when you've created a topic in the wrong forum just leave it up to the mods to

move it for you. Mkay ?

Main topic : http://www.autoitscript.com/forum/index.ph...c=34127&hl=

Share this post


Link to post
Share on other sites

HI,

or try this:

Run("notepad.exe")

Dim $time = 1000.00
Sleep(1000)
$begin = TimerInit()
While Round(TimerDiff($begin),2) <= $time
    Send("a")
    ToolTip(Round(TimerDiff($begin),2))
WEnd
Exit

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Alright, thx a lot! btw, is it possible to hold 2 keyboard buttons simultaneously? if so, how?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Alright, thx a lot! btw, is it possible to hold 2 keyboard buttons simultaneously? if so, how?

uhh

Send ("{a down}")
Send ("{b down}")
Sleep(1000)
Send ("{a up}")
Send ("{b up}")

i think that would work, hold them both down for 1 second.

edit: lol, manadar posted the exact same code as me...

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

That's amazing :lmao:

Nice code theguy0000. :ph34r:

lol

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Lol, that's kinda scary... Manadar and theguy0000 have telepathic abilites...


- Dan [Website]

Share this post


Link to post
Share on other sites

oic....well what if i want to press the up and left arrow at the same time for 1 second? I tried:

Send ("{{up} down}")

Send ("{{left} down}")

Sleep (1000)

Send ("{{up} up}")

Send ("{{left} up}")

But i dont think it worked. AutoIt actually press those letters instead =/

Share this post


Link to post
Share on other sites

Lol, that's kinda scary... Manadar and theguy0000 have telepathic abilites...

True.. We often read other people's mi... Ugh, you dirty bastard! :lmao:

Share this post


Link to post
Share on other sites

oic....well what if i want to press the up and left arrow at the same time for 1 second? I tried:

Send ("{{up} down}")

Send ("{{left} down}")

Sleep (1000)

Send ("{{up} up}")

Send ("{{left} up}")

But i dont think it worked. AutoIt actually press those letters instead =/

Send ("{up down}")
Send ("{left down}")
Sleep (1000)
Send ("{up up}")
Send ("{left up}")

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

This appears to work:

Send ("{up down}")
Send ("{left down}")
Sleep (1000)
Send ("{up up}")
Send ("{left up}")

EDIT: Damnit! theguy0000 steals it again.

Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites

This appears to work:

Send ("{up down}")
Send ("{left down}")
Sleep (1000)
Send ("{up up}")
Send ("{left up}")
hey...how'd you do that? :lmao:

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

theguy0000 reads your mind, and posts your thoughts before you can.

Or maybe the topic is cursed causing users to create duplicate posts!! :lmao:

Edited by Manadar

Share this post


Link to post
Share on other sites

theguy0000 is definately telepathic...


- Dan [Website]

Share this post


Link to post
Share on other sites

Or maybe it's the combination of the three of us, causing telepathy. The US Army would pay millions for such a thing. *dollar signs in eyes*

Share this post


Link to post
Share on other sites

Or maybe it's the combination of the three of us, causing telepathy. The US Army would pay millions for such a thing. *dollar signs in eyes*

No, they'd request your assistance for free, and if you declined, kill you so no one else could have you at a cost.... You didn't see that comming?

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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