有人可以解释一下关于 Xlib 中事件的这一部分吗?

Could someone explain this section about events in Xlib?

我感到困惑的部分来自Volume One: Xlib Programming Manual

Keyboard and pointer events are generated in the smallest window enclosing the pointer (or grabbing the pointer, as discussed in Section 8.3.2.2, "Keyboard and Pointer Grabbing"). Then an event of one of these types (only) propagates upward through the window hierarchy until the event type is found in the event_mask or do_not_propagate_mask attributes of the window. If the event is found in an event_mask first (or in both on the same window), then the event is sent as if it occurred in that window, and if it is found in a do_not_propagate_mask first, then it is never sent. The ID of the window that finally received the event (if any) is put in the window member of the event structure.

关于键盘和指针事件,作者所说的 "generated" 是什么意思?

所有事件都序列化为 32 字节的数据,"generated" 在您的上下文中是 "fill 32 bytes of data with all required information (some is common across events like target window id, event server time, some is specific to event type like x,y of pointer position or key code of key pressed )" + 将其发送到与连接关联的套接字

https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html

Events are 32 bytes long. Unused bytes within an event are not guaranteed to be zero. Every event contains an 8-bit type code. The most significant bit in this code is set if the event was generated from a SendEvent request. Event codes 64 through 127 are reserved for extensions, although the core protocol does not define a mechanism for selecting interest in such events. Every core event (with the exception of KeymapNotify) also contains the least significant 16 bits of the sequence number of the last request issued by the client that was (or is currently being) processed by the server.