title: How to check if the caps lock in on/off using C++?
body: <p>I need to check if the the Caps-Lock in on or off. </p>
  
  <p>I have tried this function</p>
  
  <pre><code>bool CheckKeyState()
  {
     if ((GetKeyState(VK_CAPITAL) &amp; 0x0001)!=0)
        return true;
  
      return false;
  
  }
  </code></pre>
  
  <p>I had to include the windows library</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  </code></pre>
  
  <p>But it is returning true weather the caps is on or off.</p>
  
  <p>what am I doing wrong? how can I check if the Caps-Lock in on or not?</p>