I've thrown together a rather-rough-but-working-in-a-limited-sense implementation of XInput2-based DirectInput.
It's got a fair few problems, I'm mainly interested in feedback on the approach, although obviously any code or style criticisms are welcome.
Current limitations: * Doesn't check for XInput2.h, so won't build without it. * Doesn't send mouse-ups. XI2 bug. * Doesn't send events after mouse-down until after mouse-up on a window. I'm pretty sure this is an XI2 bug, but it might be a design feature. * Doesn't support exclusive mode. XI2 bug (grabs not yet implemented) * Mouse buttons aren't remapped nicely downwards. Need to look harder at this, my mouse reports buttons 1, 2, 3, 4, 5, 8 and 9 under X. 4 and 5 are scroll, 6 and 7 might be horizontal scroll in which case if this is always the case we can just remap downwards. * Only supports the Mouse. Adding keyboard support should be really trivial compared to actually getting the framework right.
If this format is fine, then the first patch is basically ready to go, the latter two patches may need to be re-split or merged more sensibly.
I've also attached a couple of fixes for the XI2 stuff if anyone wants to try it. One only affects 64-bit builds, and one fixes XCB locking assertions which you could probably otherwise ignore. So they're both kinda option in the Wine context.
And one more patch, against the xinput utility from whot's git tree, to fix a compile failure.
0001-Unlock-display-after-XIQueryVersion.patch > libXi 0001-Clear-definitions-of-X-types-defined-to-wire-types.patch > x11proto-input 0001-Ensure-we-have-a-definition-of-BYTE.patch > xinput