[Xcb] Using xcb/xinput?

Uli Schlachter psychon at znc.in
Tue Jun 16 14:43:06 UTC 2020


Hi,

Am 16.06.20 um 02:46 schrieb Julian Kirsch:
> Hey there!
> 
> Although documentation is, to some extend, non-existent,

Did you already see the protocol specs?

https://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt

https://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt

[...]
> After that, I need to select events by calling `xcb_input_xi_select_events`, 
> which should be enough to receive any XInput event.
> 
> The problem is, that in my event loop, the event `XCB_GE_GENERIC` seems to never 
> be propagated.
> 
> What am I missing?

I don't know. Nothing? The right arguments?

Perhaps it helps to look at other code. According to debian codesearch,
there are six debian packages with code calling
`xcb_input_xi_select_events` [1].

I randomly picked wlroots. This seems to select input events here [2]
(Do not ask me what this does - I bet the spec can explain this). Events
are then simply handled as `XCB_GE_GENERIC` [3,4].

Does this help you?

Cheers,
Uli

[1]:
https://codesearch.debian.net/search?q=xcb_input_xi_select_events&literal=1
[2]:
https://sources.debian.org/src/wlroots/0.10.1-1/backend/x11/output.c/?hl=199#L183-L199
[3]:
https://sources.debian.org/src/wlroots/0.10.1-1/backend/x11/backend.c/#L74-L77
[4]:
https://sources.debian.org/src/wlroots/0.10.1-1/backend/x11/input_device.c/#L115-L116
-- 
"Are you preparing for another war, Plutarch?" I ask.
"Oh, not now. Now we're in that sweet period where
everyone agrees that our recent horrors should never
be repeated," he says.


More information about the Xcb mailing list