GLFW is clearly an OpenGL framework, which means we are working with graphics card. How input gets handled then?Seems like it handles all of the controllers on our system, not only graphics card.
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.