This section describes the Blender system access. Or, in other words, the way Blender retrieves events (mouse keyboard and window events) from the OS.
Here is an overview of the hierachy of event distribution in Blender:
Blender retrieves operating system (OS) events such as mouse keyboard and window related events through the OpenGL Utility Library (GLUT). At startup time, Blender installs callbacks that GLUT calls whenever there are new events available from the system. These events are accumulated in the Blender's main event queue (mainqueue).
The screenmain routine (which is installed as the GLUT idle time callback routine) handles the events related to global window management. For example, creating new windows in response to mouse clicks on the edges of Blender windows or the handling of global hotkeys. The rest of the events are distributed over the Blender windows and their headers.
Here is the a more detailed diagram of how Blender cooperates with the GLUT to process and distribute events: