Double period like Mac/iPhone Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
gvg8660
Posts: 2
Joined: 06 Dec 2018, 08:48

Double period like Mac/iPhone

06 Dec 2018, 09:00

Hello AHK community.
I hope you can help me with this feature as I am a bit of a rookie in this program. I used to be a mac user, but now I use windows. I got used to the mac function using double space to make a period (like iphone and maybe android). I have found the code below online, but often it enters a period when I actually do not want it to. The reason is obvious, as it only occurs for instance when I write ” – ” (that is <space> - <space>), as I press space twice within the specified time frame.
Can someone maybe help me to make some sort of IF statement, so if the last three letters equal ” – ” or ” I ” it does NOT replace the double spacing with a period.

Thanks ya’ll :-)

Code: (credit to user: DMG)

Code: Select all

~$space::
 {
	count++
	settimer, dotspace, -190
	keywait, space
 }
return

dotspace:
 {
	if (count = 2) #I was thinking to add the not " - " and not " I " here?
	{
		sendinput, {backspace 2}.%a_space%
	}
	count := 0
 }
return
and I have the function RapidHotKey as well.

Moderator Note: Added code tags. ~ sinkfaze
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: Double period like Mac/iPhone  Topic is solved

06 Dec 2018, 13:30

Maybe with a hotstring?

Try this to replace "space space" with "period space space"

Code: Select all

:*?:  ::.  `
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
gvg8660
Posts: 2
Joined: 06 Dec 2018, 08:48

Re: Double period like Mac/iPhone

07 Dec 2018, 01:44

Thanks for your answer. It seems to do the job and more efficient than the other code. For now I will use your solution.

However, if it is possible I would like to include the time frame, so I can press space multiple times without adding periods.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Nerafius and 78 guests