XInput2 MD without SD again

Peter Hutterer peter.hutterer at
Sun Dec 14 19:39:54 PST 2008

On Mon, Dec 15, 2008 at 12:11:04AM +0100, Christian Beier wrote:
> I have (again) a question related to the MD/SD devices introduced with
> XI2. So far i was able to feed input into pointer MDs (without SDs
> attached) via XTestFakeDevice*, but now I'm stuck with the keyboard
> MDs. These accept keycodes via XTest, but are somehow stateless, as I
> cannot press Shift and enter capital letters. I remember that is so
> intentionally and that MDs adopt the state of the last connected SD. 

not quite, they aren't stateless, but their state will be overwritten whenever
the SD sends an event. If you don't have SDs, you should be able to change
> 1) Seems quite ugly to me. Is there a cleaner way to solve this? Like
>    copying device capabilities?

I think long term the best option would be to create a virtual SD and then
control this virtual SD throug XTest and restrict the MDs to only ever react
to events from SDs, but not to actually do anything themselves. Would that
make sense?
> 2) What's worse, when I now send input to my SD-less MD, it somehow
>    re-attaches my real keyboards SD to itself again. Is this
>    intentionally so?

I don't understand what you mean in 2). Can you rephrase this please?


More information about the xorg mailing list