title: How does on-screen (virtual) keyboard works in Win10
body: <p>I haven't find anything relevant in Google or any Microsoft site about it so I decided to ask a question here.</p>
  
  <p>Everybody knows that in Win-based OS there is a <code>virtual keyboard</code>. I also know that *nix based OS, have it too. So, the question is about:</p>
  
  <blockquote>
    <p>HOW DOES IT WORK INSIDE?</p>
  </blockquote>
  
  <p>I mean, let's have an example that I opened <code>on screen keyboard</code> in Windows 10. What's the actual difference between:</p>
  
  <ol>
  <li>input via hardware keyboard: when I'm using it, like I press <code>X</code> button</li>
  <li>..and using a virtual keyboard, when I press the same button</li>
  </ol>
  
  <p>Imagine, I have an admin access to terminal/computer, is there any option to track/distinguish that in the second time I pressed button not on hardware keyboard, but on-screen (by mouse clicking) version of it?</p>
  
  <p>And there are also many different software, like AutoIt (<a href="https://en.wikipedia.org/wiki/AutoIt" rel="nofollow noreferrer">yes, it's a language</a>, but it's relevant to this example) that emulating <code>pressing the X button</code>. How does they work in Win-based OS? Do they <em>"in-common"</em> with default on-screen keyboard and using the same driver/WinAPI or there is a difference between them?</p>
  
  <p>And the second case, between:</p>
  
  <ol>
  <li>default on-screen keyboard</li>
  <li>compilated AutoIt script</li>
  <li>..any other software that emulating <code>press X button</code></li>
  </ol>
  
  <p>I guess the only way to find out <em>"how exactly button was pressed"</em> is to check current processes list via <code>taskmgr</code> and find out have anything been launched or not. Or I'm totally wrong here, and missing something?</p>
  
  <blockquote>
    <p>THE SCOPE</p>
  </blockquote>
  
  <p>I have written a node.js script which emulates button pressing behaviour in windows app. </p>
  
  <p><code>TL:DR business logic short =&gt; open notepad.exe and type `Hello world`</code></p>
  
  <p>And could someone give me any advice/recommend any powershell/bat script (<em>or any other solution</em>) with demonstration of <code>Get­Async­Key­State</code> check behavior? With which I could easily check my own <code>node.js</code> script (not by functional of it, but by triggering <code>press the X button</code> event)
  I found an answer for <code>node.js</code> case here: <a href="https://stackoverflow.com/questions/46010963/detecting-key-presses-across-applications-in-powershell">Detecting Key Presses Across Applications in Powershell</a></p>