GLFW is clearly an OpenGL framework, which means we are aming to work with graphics card initially. How input gets handled then? According to the docs, the input and window are just two main purpuses and that's just an implementation detail.

  • 1
    \$\begingroup\$ Could you be more specific? Do you mean "How could I handle inputs with GLFW?" Or "How does GLFW do to handle stuff like keyboards events and transmit that to the user?" \$\endgroup\$
    – Vaillancourt
    Feb 27, 2017 at 13:13
  • \$\begingroup\$ @AlexandreVaillancourt yes, How does GLFW do to handle stuff like keyboards events and transmit that to the user? \$\endgroup\$
    – Caleb
    Feb 27, 2017 at 14:24

1 Answer 1


First of all, GLFW is not a OpenGL framework but a OpenGL applications framework. It's basically a set of libraries and source files which facilitate you the task of build applications. This layer of abstraction allows you to write multi-platform applications without knowing anything of the Operative System API; you don't need to know how Linux manages keyboard events, just learn how GLFW.

To respond your question, keyboard, mouse, window... events are probably processed by the CPU, on the function call glfwPollEvents(). Callbacks may be added with the glfwSetKeyCallback function, as stated here. GLFW will maintain a list of functions (callbacks) to execute when the OS triggers an event.

To simplify the answer, GLFW will manage the following modules of your application (OS independent):

  • OpenGL: OpenGL API management. Mostly processed by the GPU.
  • Window: System window management (resize, resolution, etc). Processed by the GPU (rendering) and CPU (processing).
  • Events: Events fired by the Operative System (keyboard events, mouse events, window events...). Mostly processed by the CPU.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .