title: OpenGL get cursor coordinate on mouse click in C++
body: <p>Fairly new to using GLFW, I want to output the cursor coordinate onto the console whenever the left mouse button in clicked. However, I am not getting any output at all. </p>
  
  <pre><code>static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
  {
      //ESC to quit
      if (key == GLFW_KEY_ESCAPE &amp;&amp; action == GLFW_PRESS)
      {
          glfwSetWindowShouldClose(window, GL_TRUE);
          return;
      }
      if (key == GLFW_MOUSE_BUTTON_LEFT &amp;&amp; action == GLFW_PRESS) 
      {
          double xpos, ypos;
          //getting cursor position
          glfwGetCursorPos(window, &amp;xpos, &amp;ypos);
          cout &lt;&lt; "Cursor Position at (" &lt;&lt; xpos &lt;&lt; " : " &lt;&lt; ypos &lt;&lt; endl;
      }
  }
  </code></pre>