title: Low Level Hook / SetWindowsHookEx lParam Auto-Repeat?
body: <p>Reading here:
  <a href="https://stackoverflow.com/questions/876852/how-is-keyboard-auto-repeat-implemented-on-a-windows-pc?answertab=votes#tab-top">How is keyboard auto-repeat implemented on a Windows PC?</a></p>
  
  <p>I understand that low level keyboard hook does't receive auto-repeat count :/<br></p>
  
  <blockquote>
    <p>Note that the low level keyboard hook (WH_KEYBOARD_LL) does not
    receive the repeat count.</p>
  </blockquote>
  
  <p>But why?? o.O</p>
  
  <p>The way I used to extract the auto-repeat count using windows messages:<br>
  <code>int repeatCount = (lParam &amp; KF_REPEAT);</code></p>
  
  <p>But it doesn't work for some reason when I use the <code>SetWindowsHookEx</code> hooking the <code>WH_KEYBOARD_LL</code>.</p>
  
  <p>I want to filter auto-repeat for the <code>Space</code> key while using the global hook. Is there a way doing that? Possibly a creative way to determine if the key down press is auto-repeated(i.e held down)?</p>
  
  <p>Sample code:</p>
  
  <pre><code>    if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN)
      {
          KBDLLHOOKSTRUCT kbd = *(KBDLLHOOKSTRUCT *)(lParam);
          if (kbd.vkCode == VK_SPACE &amp;&amp; !(lParam &amp; KF_REPEAT))
          {
              // do something
          }
      }
  </code></pre>