— Today we'll look at a slightly different technique for capturing keyboard events.
The X server sits between the GUI and the OS and is responsible for providing various primitives.
It implements the "windows, icons, menus, pointers" paradigm, which is the foundation of a GUI system.
The basic method for capturing input is as follows:
⏺Checking if the X server is running;
⏺Listing available displays;
⏺Selecting the desired display;
⏺Checking if XInputExtension is available;
⏺Setting an event mask to enable keystroke events;
⏺Reading events from the display in a loop.