title: Autohotkey layout independent "Input". Wait for any key. "Input" alternatives
body: <p>Here goes part of my script:</p>
  
  <pre><code>~LWin Up::
    Input, key, L1
    if (key = "n") {
      Run, Notepad.exe
    }
    else if (key = "s") {
      Run, cmd.exe
    }      
  return
  </code></pre>
  
  <p>After releasing LWin it waits for another key to be pressed, then runs application corresponding to the key. Тhe problem is that if I switch to russian layout 's' turns to 'ы' and the script won't work. </p>
  
  <p>How do I make it layout independent? Duplicating the code for 'ы' isn't the option.</p>
  
  <p>The solution might be something like this:</p>
  
  <pre><code>#n::
  #s::
    stringsplit, splitted_, A_ThisHotkey
    key := splitted_2
    if (key = "n") {
      Run, Notepad.exe
    }
    else if (key = "s") {
      Run, cmd.exe
    }
    Send {LWin up} ; release LWin
  return
  
  ~LWin Up::
    stringsplit, splitted_, A_PriorHotkey
    if (splitted_1 = "#") { ; if win+key combo has just been released
      return                ; no need to keep LWin down
    }
    Send {LWin down}        ; else keep it down
  return
  </code></pre>
  
  <p>I've tried it but it doesn't work properly. Sometimes it won't release LWin, sometimes it won't keep it pressed. Plus that approach has other drawbacks so I don't want to use it.</p>