title: Keyboard input using windows API c++
body: <p>I really need some help here. I am trying to create an input system using the windows api, but I really cannot understand how to use it. I got the code below from</p>
  
  <p><a href="https://docs.microsoft.com/en-us/windows/desktop/learnwin32/keyboard-input" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows/desktop/learnwin32/keyboard-input</a></p>
  
  <p>I understand that it returns some kind of result depending on the key pressed, but how do I actually get the result that is returned from this function? How do I use it? Any help would be appreciated. </p>
  
  <pre><code>LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  {
      wchar_t msg[32];
      switch (uMsg)
      {
      case WM_SYSKEYDOWN:
          swprintf_s(msg, L"WM_SYSKEYDOWN: 0x%x\n", wParam);
          OutputDebugString(msg);
          break;
  
      case WM_SYSCHAR:
          swprintf_s(msg, L"WM_SYSCHAR: %c\n", (wchar_t)wParam);
          OutputDebugString(msg);
          break;
  
      case WM_SYSKEYUP:
          swprintf_s(msg, L"WM_SYSKEYUP: 0x%x\n", wParam);
          OutputDebugString(msg);
          break;
  
      case WM_KEYDOWN:
          swprintf_s(msg, L"WM_KEYDOWN: 0x%x\n", wParam);
          OutputDebugString(msg);
          break;
  
      case WM_KEYUP:
          swprintf_s(msg, L"WM_KEYUP: 0x%x\n", wParam);
          OutputDebugString(msg);
          break;
  
      case WM_CHAR:
          swprintf_s(msg, L"WM_CHAR: %c\n", (wchar_t)wParam);
          OutputDebugString(msg);
          break;
  
      /* Handle other messages (not shown) */
  
      }
      return DefWindowProc(m_hwnd, uMsg, wParam, lParam);
  }
  </code></pre>