title: Keyboard input hesitation when held down?
body: <p>Does anyone know why there is some hesitation when you hold down a keyboard key and try to process it? I'm calling a function right in my WinProc(...) that will move an image on the screen (OpenGL) when a key is held down. I press it and get a single response, then there is about .5 seconds of nothing, then it behaves as normal (moves 1 pixel every WinMain loop).</p>
  
  <p>I'm wondering if the Windows messages are being delayed somehow because of some feature I need to disable???</p>
  
  <p>Here's my code:</p>
  
  <pre><code>int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int nshowcmd)
  {
      bool quit = false;
      MSG msg;
  
      createWindow(hinstance, SCRW, SCRH, SCRD, WINDOWED);
  
      // Main loop
      while (!quit)
      {       
          if (PeekMessage(&amp;msg, NULL, NULL, NULL, PM_REMOVE))
          {
              if (msg.message == WM_QUIT)
                  quit = true;
  
              TranslateMessage(&amp;msg);
              DispatchMessage(&amp;msg);
          }
  
          renderFrame();        // processes graphics
          SwapBuffers(hdc);
      }
      return msg.lParam;
  }
  </code></pre>
  
  <p>and WinProc (there were more cases but same thing...):</p>
  
  <pre><code>    LRESULT CALLBACK WinProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
      {
          switch(msg)
          {
              case WM_KEYDOWN:
                  switch ( wparam )
                  {
                      case VK_RIGHT:
                          key_RIGHT();
                          return 0;
                  }
                  return 0;
  }
  }
  </code></pre>
  
  <p>and key_RIGHT:</p>
  
  <pre><code>void key_RIGHT()
  {
      MoveObjectRight1Pixel();
  }
  </code></pre>