title: Easy input stress mark with apostrophe in US keyboards
body: <p>I'm trying to make a script that changes the way apostrophes work in International US keyboards.</p>
  <p>They normally work by pressing ' once and then a vowel for an accent (á,é,í,ó,ú) or a consonant for an apostrophe ('m'l) and so for an apostrophe before a vowel ('a,'o) you need to double press then backspace then type the vowel.</p>
  <p>This double press then backspace is the bottleneck I'm trying to solve here.</p>
  <p>I've come up with this solution to the problem:</p>
  <pre><code>/* Bit of code A */
  $'::Send `'{Space}
  $+a::Send % (A_PriorHotkey = &quot;$'&quot;) ? &quot;{bs}á&quot; : &quot;a&quot;
  $+e::Send % (A_PriorHotkey = &quot;$'&quot;) ? &quot;{bs}é&quot; : &quot;e&quot;
  $+i::Send % (A_PriorHotkey = &quot;$'&quot;) ? &quot;{bs}í&quot; : &quot;i&quot;
  $+o::Send % (A_PriorHotkey = &quot;$'&quot;) ? &quot;{bs}ó&quot; : &quot;o&quot;
  $+u::Send % (A_PriorHotkey = &quot;$'&quot;) ? &quot;{bs}ú&quot; : &quot;u&quot;
  </code></pre>
  <p>this makes so the ' only becomes an accent in case shift is pressed while typing the vowel but as you may have noticed this also breaks &quot;alt capitalization&quot; for vowels on my keyboard.
  I've tried creating a parallel script that would make them behave normally when not preceded by '</p>
  <pre><code>/* Bit of code B */
  $+a::Send % (A_PriorHotkey = &quot;&quot;) ? &quot;A&quot; : &quot;a&quot;
  $+e::Send % (A_PriorHotkey = &quot;&quot;) ? &quot;E&quot; : &quot;e&quot;
  $+i::Send % (A_PriorHotkey = &quot;&quot;) ? &quot;I&quot; : &quot;i&quot;
  $+o::Send % (A_PriorHotkey = &quot;&quot;) ? &quot;O&quot; : &quot;o&quot;
  $+u::Send % (A_PriorHotkey = &quot;&quot;) ? &quot;U&quot; : &quot;u&quot;
  </code></pre>
  <p>But this cannot run as the two scripts overlap and this would only solve capitalization at the begging of a sentence.</p>
  <p>So it should be:</p>
  <pre><code>/* Bit of code C */
  $+a::Send % (A_PriorHotkey = &quot;anything other than '&quot;) ? &quot;A&quot; : &quot;a&quot;
  $+e::Send % (A_PriorHotkey = &quot;anything other than '&quot;) ? &quot;E&quot; : &quot;e&quot;
  $+i::Send % (A_PriorHotkey = &quot;anything other than '&quot;) ? &quot;I&quot; : &quot;i&quot;
  $+o::Send % (A_PriorHotkey = &quot;anything other than '&quot;) ? &quot;O&quot; : &quot;o&quot;
  $+u::Send % (A_PriorHotkey = &quot;anything other than '&quot;) ? &quot;U&quot; : &quot;u&quot;
  </code></pre>
  <p>How can I structure my code to if (A_PriorHotkey = &quot;'&quot;) run <code>/* Bit of code A */</code> else
  <code>/* Bit of code C */</code>.</p>