1
votes

Is there an option in AutoHotKey so that a hotstring can be triggered even if it does not start a word?

For instance, I would like to substitute occourrences of a' in à, so that when I type citta' I obtain città.

(Very helpful for Italians working on English keyboards :) )

2

2 Answers

0
votes

What I've done is similar, but reversed. I set my keyboard to US (not international) and created some hotkeys like this. In this example you type ` and then a to get à, but you could try to switch this around.

Here is (a section of) my example:

:?C*:`` :: ; Turn `{Space} into neutral `, else ` will be used in next vowel.
    Send, ``{Space}{BackSpace}
Return

:?C*:``a::à
:?C*:``i::ì
:?C*:``e::è
:?C*:``o::ò
:?C*:``u::ù
:?C*:``A::À
:?C*:``I::Ì
:?C*:``E::È
:?C*:``O::Ò
:?C*:``U::Ù

:?C*:^ :: ; Turn ^{Space} into neutral ^, else ^ will be used in next vowel.
    Send, {^}{Space}{BackSpace}
Return

:?C*:^a::â
:?C*:^i::î
:?C*:^e::ê
:?C*:^o::ô
:?C*:^u::û
:?C*:^A::Â
:?C*:^I::Î
:?C*:^E::Ê
:?C*:^O::Ô
:?C*:^U::Û


:?C*:`" :: ; Turn "{Space} into neutral ", else " will be used in next vowel.
    Send, +{'}{Space}{BackSpace}
Return

:?C*:`"a::ä
:?C*:`"i::ï
:?C*:`"e::ë
:?C*:`"o::ö
:?C*:`"u::ü
:?C*:`"A::Ä
:?C*:`"I::Ï
:?C*:`"E::Ë
:?C*:`"O::Ö
:?C*:`"U::Ü
0
votes

I know it's been 4 years, but for those who are still looking for an answer:

:?:a'::à

The ? makes the hotstring triggerable mid-word.

From the docs:

? (question mark): The hotstring will be triggered even when it is inside another word; that is, when the character typed immediately before it is alphanumeric. For example, if :?:al::airline is a hotstring, typing "practical " would produce "practicairline ". Use ?0 to turn this option back off.

Hope this helps!