https://invisible-island.net/xterm/xtoolkit/
XtLastEventProcessed, XtLastTimestampProcessed - last event, last time- stamp processed
#include <X11/Intrinsic.h> XEvent* XtLastEventProcessed(Display* display); Time XtLastTimestampProcessed(Display* display);
display Specifies the open display connection.
XtLastEventProcessed returns the last event passed to XtDispatchEvent for the specified display and NULL if there has been no event. The client must not modify the contents of the returned event. XtLastTimestampProcessed returns the timestamp of the last KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify, EnterNotify, LeaveNotify, PropertyNotify, or SelectionClear event that has been passed to XtDispatchEvent for the specified display and zero if there has been no such event.
X Toolkit Intrinsics – C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.5.2 XtLastEventProcessed(3)