Speed in typing vs pasting

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Speed in typing vs pasting

28 Jun 2017, 08:16

Hi, this isn't really asking for help, but I don't know where else to put it.

I can easily see a difference in timing between these 2 scripts. Does anyone know how you would get AHK to type as fast as Windows does when you paste? Or maybe no one else can see the difference? As I see it, sending ^v sends my email address all at once, as one character. But when I use SendInput, I can see the cursor moving along infront of the letters as they are typed. It is fast, but not as fast. Not that it matters a whole lot. But if Windows can do it when you hit Ctrl + V, why can't AHK?

Code: Select all

Capslock & Ins::
past = %Clipboard%
Clipboard =
Clipboard = [email protected]
ClipWait
SendInput, ^v
Clipboard = %past%
past =
return

Capslock & Home::
past = %Clipboard%
Clipboard =
Clipboard = [email protected]
ClipWait
SendInput, %Clipboard%
Clipboard = %past%
past =
return
try it and see
...
User avatar
Bragato
Posts: 13
Joined: 28 Jun 2017, 07:38

Re: Speed in typing vs pasting

28 Jun 2017, 08:21

CtrlV is instataneous, it just pastes all of your clipboard.
SendInput the autohotkey is sending key per key, it's "typing". Autohotkey has a default delay for sending keys, that's where your "cursos moving" comes from.
https://autohotkey.com/docs/commands/SetKeyDelay.htm
Default delay is 10ms, you can set it to -1 for no delay at all or 0 to the smallest delay possible.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Speed in typing vs pasting

28 Jun 2017, 08:32

Hey, thanks for pointing that out. I never knew about SetKeyDelay before. I figured there would be something possible and simple. :D

EDIT: I just looked up SetKeyDelay in the docs, and it says this:
Note: SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode.

So if I Use SendInput already, it should be as fast as it gets?
try it and see
...
User avatar
Bragato
Posts: 13
Joined: 28 Jun 2017, 07:38

Re: Speed in typing vs pasting

28 Jun 2017, 08:48

https://autohotkey.com/docs/commands/Se ... nputDetail

Maybe then the delay to SendInput is the lowest possible OR your sendinput is reverting to sendplay as it says it may do... If so, setkeydelay is obeyed.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Speed in typing vs pasting

28 Jun 2017, 08:59

Hmm, this stuff is interesting. So I put SetKeyDelay, -1 in the code, but it didn't make much difference, so I changed it to Send, and disabled Sendmode, Input. Then it is nearer the speed of Ctrl + v. But I think still not quite. :). I wonder if I could set up something complicated like ControlGetFocus, ControlSetText? Putting the text where the cursor is?
try it and see
...
User avatar
Bragato
Posts: 13
Joined: 28 Jun 2017, 07:38

Re: Speed in typing vs pasting

28 Jun 2017, 09:08

Don't know that haha, I have very basic knowledge on AHK commands, the keydelay i used before, but control... haha
If I may ask, why don't you just use CTRLV? Or you're curious about the delay difference haha?
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Speed in typing vs pasting

28 Jun 2017, 09:49

Ya, just curious. :D I like to learn more about AHK where I can. So, its not a urgent need or anything close. ;)
try it and see
...
Fantankerous
Posts: 5
Joined: 16 May 2017, 15:30

Re: Speed in typing vs pasting

28 Jun 2017, 11:53

Whether you type vs paste matters in the URL field of Chrome. (default settings)

If you use send, Google tries to autocomplete. If you paste, autocomplete is bypassed.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Speed in typing vs pasting

28 Jun 2017, 13:21

SendInput reverts to SendEvent by default. It can be changed via SendMode, InputThenPlay. The speed at which the text you send appears is also dependent on the target window.

You might be interested in Control, EditPaste, String.

Cheers.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Speed in typing vs pasting

28 Jun 2017, 13:42

Hey, thanks for that info Helgef. EditPaste would be just what I was looking for. I was looking through that list, but missed picking that out.

I'm also learning about the complexity of send modes. But sadly I don't have the time to tinker just now. mebbe later.
try it and see
...

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: tabr3 and 266 guests