title: how can we simulate keyboard keys using vbs?
body: <p>I'm aware of <a href="https://stackoverflow.com/questions/5345693/simulate-enter-key">the probably most common form</a>:</p>
  
  <pre><code>set wShell = createObject("wscript.shell")
  wShell.sendKeys ":){ENTER}"
  </code></pre>
  
  <p>this <a href="https://stackoverflow.com/questions/12877547/vbscript-sendkeys-ctrllwintab">uncommon and limited way</a>:</p>
  
  <pre><code>Set ShellApp = CreateObject("Shell.Application")
  ShellApp.WindowSwitcher
  </code></pre>
  
  <p>we can <em>hackishly</em> <a href="https://stackoverflow.com/questions/26187708/write-a-batch-script-to-press-tab-and-enter-key#">use sleep</a> if we want a sequence of keys which depends on other events:</p>
  
  <pre><code>WScript.sleep 987
  wShell.sendKeys "foo{!}~"
  WScript.sleep 789
  wShell.sendKeys "^a^c"
  </code></pre>
  
  <p>and we can't really keep a key pressed but <a href="https://stackoverflow.com/questions/42422088/permanently-press-key-via-vbs-keep-key-pressed">we can repeat it many times</a>:</p>
  
  <pre><code>wShell.sendKeys "{LEFT 42}"
  </code></pre>
  
  <p>now... am I missing something?</p>