::--::— was working just fine for me by itself to send an em dash
— in any application by typing two consecutive hyphens or minus signs, just like this works in Microsoft Word and Telegram without the intervention of an AHK script, which is also why I have the code looking like this:
Code: Select all
#HotIf !WinActive("ahk_exe Telegram.exe")
::--::—
::---::– ; This is the addition that doesn't quite work due to two consecutive minus signs sending the em dash before an en dash can be sent.
#HotIf
However, now I also need to quickly type an en dash
–. The immediate idea that came to me was to send it by typing 3 consecutive minus signs. As expected, this clashes with sending an em dash with 2 consecutive minus signs, as an em dash is immediately sent after typing 2 consecutive minus signs before an en dash can be sent by typing three of them.
Alternatively, I could also send two minus signs for an em dash
— and
hold down the minus-sign key for a bit longer than normal to send an en dash. I tried to write the code for this one but failed.
I'm looking for a solution to this problem, or an even better idea than typing 3 consecutive minus signs or holding down minus to send an en dash.
Thanks for any help and tips on this issue.