title: GetasyncKeyState() not working in C++
body: <p>I have thew following code:</p>
  
  <pre><code>void InitDirect3DApp::updateScene(float dt)
  {
      D3DApp::updateScene(dt);
  
      // Update angles based on input to orbit camera around box.
      if(GetKeyState('A') &amp; 0x8000) mTheta -= 2.0f*dt;
      if(GetKeyState('D') &amp; 0x8000) mTheta += 2.0f*dt;
      if(GetKeyState('W') &amp; 0x8000) mPhi -= 2.0f*dt;
      if(GetKeyState('S') &amp; 0x8000) mPhi += 2.0f*dt;
  
  
      // Restrict the angle mPhi.
      if( mPhi &lt; 0.1f ) mPhi = 0.1f;
      if (mPhi &gt; PI - 0.1f) mPhi = PI-0.1f;
  
      // Convert Spherical to Cartesian coordinates: mPhi measured from +y
      // and mTheta measured counterclockwise from -z.
      float x = 5.0f * sinf(mPhi) * sinf(mTheta);
      float z = -5.0f * sinf(mPhi) * cosf(mTheta);
      float y = 5.0f * cosf(mPhi);
  
      // Build the view matrix.
      D3DXVECTOR3 pos(x, y, z);
      D3DXVECTOR3 target(0.0f, 0.0f, 0.0f);
      D3DXVECTOR3 up(0.0f, 1.0f, 0.0f);
      D3DXMatrixLookAtLH(&amp;mView, &amp;pos, &amp;target, &amp;up);
  }
  </code></pre>
  
  <p>Problem is that the code inside the if statements after GetKeyState is not run no matter if the relevant keys are pressed.  I've tried upper case and lower case, but GetKeyState doesn't seem to do anything.</p>
  
  <p>I'm using Visual C++ 2008 Express on Windows 8.1</p>
  
  <p>UPDATE:
  Here is the code I have for the message pump:</p>
  
  <pre><code>MSG msg = { 0 };
  
  mTimer.reset();
  
  while (msg.message != WM_QUIT)
  {
      // If there are Window messages then process them.
      if (PeekMessage(&amp;msg, 0, 0, 0, PM_REMOVE))
      {
          TranslateMessage(&amp;msg);
          DispatchMessage(&amp;msg);
      }
      // Otherwise, do animation/game stuff.
      else
      {
          mTimer.tick();
  
          if (!mAppPaused)
              updateScene(mTimer.getDeltaTime());
          else
              Sleep(50);
  
          drawScene();
      }
  }
  return (int)msg.wParam;
  </code></pre>
  
  <p>I have also tried getasynckeystate with the same result.</p>