[Xcb] xcb-xinput -- raw motion events

Peter Harris pharris at opentext.com
Wed May 27 08:32:26 PDT 2015


On 2015-05-26 16:43, Ingo Bürk wrote:
> 
> How do I detect the XI_RawMotion event in the event loop now, though? It
> seems that I receive it as type 35,
> but both Xlib and XCB define the code to be 17. Storing the offset for
> the xinput extension (queried through XCB, but that shouldn't matter,
> no?) shows an offset of 66 in my case. So I'm not quite sure how these
> numbers would make up the 35 I'm seeing.

Old style event extensions (using the event offset) ran out of numbers,
and the fixed event length of 32 bytes was too limiting, so they
introduced the "Generic Event Extension" to fix both of these problems.

Xinput1 events use the event offset. Xinput2 events use "Generic Event
Extension" events instead.

35 is the event number for the new "Generic Event Extension". Due to
unfortunate naming, xcb already had a xcb_generic_event_t before the ge
extension was added, so the event struct you want is xcb_ge_generic_event_t.

Cast the event to (xcb_ge_generic_event_t *), and check that
->response_type is XCB_GE_GENERIC (35), ->extension is the extension
number (major_opcode, not first_event) of xinput, and ->event_type is
the xinput ge event number (in this case, 17).

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://connectivity.opentext.com/
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866


More information about the Xcb mailing list