[Xcb] xcb-xinput -- raw motion events
Ingo Bürk
admin at airblader.de
Wed May 27 08:58:44 PDT 2015
Hi Peter,
thank you so much, this seems to work. And, more importantly, my hope
that this will avoid the weird Chromium bug seems to have come true as
well :)
Ingo
On 05/27/2015 05:32 PM, Peter Harris wrote:
> 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
More information about the Xcb
mailing list