How to make '@@' (@ doubletap) a shortcut to insert e-mail?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
THX1138
Posts: 63
Joined: 25 Jul 2017, 00:36

How to make '@@' (@ doubletap) a shortcut to insert e-mail?

25 Sep 2017, 14:42

I want to use a script to insert my e-mail address when I double tap the @ key whilst holding the shift key (the shift key needs to be held in order for the @ key to function as an @ key). I have copied the e-mail insert script from somewhere else, I just don't know what to put at the beginning? I guess it's not as simple as '@@'?

Code: Select all

::
Clipsave:=ClipboardAll ; save clip
Clipboard:="" ; empty clip
Clipboard := "[email protected]" ; put your email in clip
ClipWait ; wait
Send, ^v ; send paste
Sleep, 50 ; Wait a few ms
Clipboard:=Clipsave ; restore clip to not interrupt standard operation
return

Esc::ExitApp ; Failsafe exit
User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: How to make '@@' (@ doubletap) a shortcut to insert e-mail?

25 Sep 2017, 19:27

This should work for ya, keeps original functionality of @ but double tapping send your email.

Code: Select all

tapDelay := 450 ;time between taps to activate script, lower = must press faster
email := "[email protected]"

~@::
if (lastTap > a_tickcount) { ;if the time since last press is smaller than delay, activate
	sendinput {backspace 2}%email% ;send backspace twice, then email
}
lastTap := a_tickcount + tapDelay
return
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: How to make '@@' (@ doubletap) a shortcut to insert e-mail?

25 Sep 2017, 19:31

I would consider doing just a hotstring. An auto-replace one at that: :*:@@::[email protected] The * option here makes it fire as soon as the second @ is pressed instead of waiting for ending punctuation or a space.
THX1138
Posts: 63
Joined: 25 Jul 2017, 00:36

Re: How to make '@@' (@ doubletap) a shortcut to insert e-mail?

25 Sep 2017, 21:42

Thank you both for your responses. <3 Unfortunately, the first one doesn't seem to do anything on my machine but the second seems to work as intended.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR and 282 guests