Can you provide me example code (on any language) which use record extension via XCB? There are many examples of how to do it with Xlib (https://gist.github.com/whym/402801) but I can't understand how to translate this part of Xlib code to XCB:
# Create a recording context; we only want key and mouse events
ctx = record_dpy.record_create_context(
0,
[record.AllClients],
[{
'core_requests': (0, 0),
'core_replies': (0, 0),
'ext_requests': (0, 0, 0, 0),
'ext_replies': (0, 0, 0, 0),
'delivered_events': (0, 0),
'device_events': (X.KeyPress, X.KeyPress),
'errors': (0, 0),
'client_started': False,
'client_died': False,
}]
)
XCB docs for xcb_record_create_context(...) is totally mess. Any working code will be helpful.
The short version: You don't want to work with the RECORD extension. It's messy with Xlib and it's plain ugly with xcb.
Anyway, some example using Xlib and libXtst: https://github.com/nibrahim/showkeys/blob/master/tests/record-example.c
The same code (roughly) translated to xcb (notice that this has to parse a blob of data itself that normally libXtst helps with, no idea if this really is possible in practice, but the spec says that this is possible in theory):