title: GetKeyState function not working when checking if left mouse button is clicked
body: <p>I am trying to see if the left mouse button is clicked and if it is it will output <code>You clicked</code> I have this piece of code which will work the first time you click. After that though, I have to right click and then left click in order for it to work again. If I just left click nothing will happen. Why is this?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;windows.h&gt;
  using namespace std;
  
  int main()
  {
      while (true)
      {
          if (GetKeyState(VK_LBUTTON) &lt; 0) {
              cout &lt;&lt; "clicked" &lt;&lt; endl;
          }
      }
  
  
  }
  </code></pre>