KeymapNotify
An X11 event that reports which keys are already held down when a window gains focus or the pointer enters it.
A program that gets focus halfway through a keystroke has missed the KeyPress — it went to whoever had focus at the time. If the client has selected KeymapStateMask, the server therefore sends a KeymapNotify right after every EnterNotify or FocusIn. The payload is a bit vector with one bit per keycode, set meaning pressed. The program can then know that Shift is already down instead of guessing.
It is the only core event without a sequence number. Every event is exactly 32 bytes, the bit vector needs 31 of them, and something had to give. The same information can be fetched synchronously with XQueryKeymap, at the cost of a round trip.