THE INPUT STACK ON LINUX (6 HOUR READ)
Input handling on Linux can be divided into two parts, separated by a common layer. Kernel-level handling deals with what happens in the kernel and how events are exposed to user-space. User-space handling includes the user-space device manager and hardware database for device management and setup, the libinput library for general input and other libraries such as XKB for keyboards, and Widgets, X Server, X11 window managers, and Wayland compositors. The middle exposed layer includes the event abstraction subsystem, devtmpfs for device nodes, sysfs for kernel objects and device attributes, and procfs for an introspection interface of the input core.